Skip to main content
Version: 1.41.x

Build rules generated by npm_translate_lock

These are loaded from the external repository created by npm_translate_lock based on the name provided.

For example, if you run npm_translate_lock(name = "npm") then these rules can be loaded with

load("@npm//:defs.bzl", "npm_link_targets", "npm_link_all_packages")

Macros and Functions

Generated list of npm_link_package() target generators and first-party linked packages corresponding to the packages in {pnpm_lock_label}

If you use manually-written npm_import you can link these as well, for example,

load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm_meaning-of-life__links//:defs.bzl", npm_link_meaning_of_life = "npm_link_imported_package")

npm_link_all_packages(
name = "node_modules",
imported_links = [
npm_link_meaning_of_life,
],
)

Example usage (generated):

load("@aspect_rules_js//npm:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(
)

name

Optional. Default: "node_modules"

name of catch all target to generate for all packages linked

Optional. Default: []

optional list link functions from manually imported packages that were fetched with npm_import rules.

Generated list of target names that are linked by npm_link_all_packages()

Example usage (generated):

load("@aspect_rules_js//npm:defs.bzl", "npm_link_targets")

npm_link_targets(
)

name

Optional. Default: "node_modules"

name of catch all target to generate for all packages linked

package

Optional. Default: None

Bazel package to generate targets names for.

Set to an empty string "" to specify the root package.

If unspecified, the current package (native.package_name()) is used.