Install npm packages
Overview
Rules to install NodeJS dependencies during WORKSPACE evaluation. This happens before the first build or test runs, allowing you to use Bazel as the package manager.
See discussion in the README.
npm_install
npm_install(name, data, exclude_packages, included_files, manual_build_file_contents, package_json, package_lock_json, prod_only, quiet, timeout)
Runs npm install during workspace setup.
Attributes
name |
A unique name for this rule. |
data |
|
exclude_packages |
List of packages to exclude from install.
|
included_files |
List of file extensions to be included in the npm package targets.
|
manual_build_file_contents |
Experimental attribute that can be used to override
the generated BUILD.bazel file and set its contents manually.
Can be used to work-around a bazel performance issue if the
default |
package_json |
|
package_lock_json |
|
prod_only |
Don't install devDependencies |
quiet |
If stdout and stderr should be printed to the terminal. |
timeout |
Maximum duration of the command "npm install" in seconds (default is 600 seconds). |
yarn_install
yarn_install(name, data, exclude_packages, included_files, manual_build_file_contents, package_json, prod_only, quiet, timeout, use_global_yarn_cache, yarn_lock)
Runs yarn install during workspace setup.
Attributes
name |
A unique name for this rule. |
data |
|
exclude_packages |
List of packages to exclude from install.
|
included_files |
List of file extensions to be included in the npm package targets.
|
manual_build_file_contents |
Experimental attribute that can be used to override
the generated BUILD.bazel file and set its contents manually.
Can be used to work-around a bazel performance issue if the
default |
package_json |
|
prod_only |
Don't install devDependencies |
quiet |
If stdout and stderr should be printed to the terminal. |
timeout |
Maximum duration of the command "yarn" in seconds. (default is 600 seconds). |
use_global_yarn_cache |
Use the global yarn cache on the system. The cache lets you avoid downloading packages multiple times. However, it can introduce non-hermeticity, and the yarn cache can have bugs. Disabling this attribute causes every run of yarn to have a unique cache_directory. |
yarn_lock |
|