| # Copyright 2019 The Bazel Authors. All rights reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| workspace( |
| name = "examples_parcel", |
| managed_directories = {"@npm": ["node_modules"]}, |
| ) |
| |
| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| |
| http_archive( |
| name = "build_bazel_rules_nodejs", |
| sha256 = "c9c5d60d6234d65b06f86abd5edc60cadd1699f739ee49d33a099d2d67eb1ae8", |
| urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.0/rules_nodejs-4.4.0.tar.gz"], |
| ) |
| |
| load("@build_bazel_rules_nodejs//nodejs:repositories.bzl", "rules_nodejs_dependencies") |
| |
| rules_nodejs_dependencies() |
| |
| load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install") |
| |
| node_repositories( |
| # with node 16, this example fails on circleCI, because |
| # parcel has a gyp build on install that fails due to wrong |
| # version of the python interpreter: |
| # npm ERR! code 1 |
| # npm ERR! path /tmp/tmp-22804uFaivyUQN3f5/node_modules/deasync |
| # npm ERR! command failed |
| # npm ERR! command sh -c node ./build.js |
| # npm ERR! gyp info it worked if it ends with ok |
| # npm ERR! gyp info using node-gyp@8.2.0 |
| # npm ERR! gyp info using node@16.12.0 | linux | x64 |
| # npm ERR! gyp ERR! find Python |
| # npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration |
| # npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON |
| # npm ERR! gyp ERR! find Python checking if "python3" can be used |
| # npm ERR! gyp ERR! find Python - executable path is "/usr/bin/python3" |
| # npm ERR! gyp ERR! find Python - version is "3.5.3" |
| # npm ERR! gyp ERR! find Python - version is 3.5.3 - should be >=3.6.0 |
| # npm ERR! gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED |
| node_version = "14.17.5", |
| ) |
| |
| npm_install( |
| name = "npm", |
| exports_directories_only = True, |
| package_json = "//:package.json", |
| package_lock_json = "//:package-lock.json", |
| ) |