| workspace(name = "vendored_node_example") |
| |
| # In your code, you'd fetch this repository with an `http_archive` call. |
| # We do this local repository only because this example lives in the same |
| # repository with the rules_nodejs code and we want to test them together. |
| local_repository( |
| name = "build_bazel_rules_nodejs", |
| path = "../../bazel-bin/local_testing_package", |
| ) |
| |
| load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "npm_install", "yarn_install") |
| |
| node_repositories( |
| vendored_node = "@vendored_node_example//:node-v10.12.0-linux-x64", |
| vendored_yarn = "@vendored_node_example//:yarn-v1.10.0", |
| ) |
| |
| yarn_install( |
| name = "yarn", |
| package_json = "//:package.json", |
| yarn_lock = "//:yarn.lock", |
| ) |
| |
| npm_install( |
| name = "npm", |
| package_json = "//:package.json", |
| package_lock_json = "//:package-lock.json", |
| ) |