blob: 53785a9683ee76e56dec8a55adce0af07c34afb6 [file] [log] [blame]
workspace(name = "program_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")
# Install a hermetic version of node.
# After this is run, these labels will be available:
# - NodeJS:
# @nodejs//:node
# - NPM:
# @nodejs//:npm
# - The yarn package manager:
# @nodejs//:yarn
node_repositories(
node_version = "8.11.1",
package_json = ["//:package.json"],
yarn_version = "1.5.1",
)
# Now the user must run either
# bazel run @nodejs//:yarn
# or
# bazel run @nodejs//:npm