Skip to content

Latest commit

 

History

History
68 lines (41 loc) · 2.4 KB

npm_link_all_packages.md

File metadata and controls

68 lines (41 loc) · 2.4 KB

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")

npm_link_all_packages

npm_link_all_packages(name, imported_links)

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,
    ],
)

PARAMETERS

Name Description Default Value
name name of catch all target to generate for all packages linked "node_modules"
imported_links optional list link functions from manually imported packages that were fetched with npm_import rules. []

npm_link_targets

npm_link_targets(name, package)

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

PARAMETERS

Name Description Default Value
name name of catch all target to generate for all packages linked "node_modules"
package 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.
None

RETURNS

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