Skip to content

Instantly share code, notes, and snippets.

@mr-pascal
Last active January 22, 2022 08:37
Show Gist options
  • Select an option

  • Save mr-pascal/9b564c2164f81a6c8680dc1377a22ce0 to your computer and use it in GitHub Desktop.

Select an option

Save mr-pascal/9b564c2164f81a6c8680dc1377a22ce0 to your computer and use it in GitHub Desktop.
workspace(
name = "my_workspace",
# Bazel should manage the "node_modules" directory
managed_directories = {"@npm": ["node_modules"]},
)
// ...
load("@build_bazel_rules_nodejs//:index.bzl", "npm_install")
npm_install(
# Name this npm so that Bazel Label references look like @npm//package
name = "npm",
# Paths to the package*.json files
package_json = "//:package.json",
package_lock_json = "//:package-lock.json",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment