Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspect.build/llms.txt

Use this file to discover all available pages before exploring further.

Public API surface is re-exported here. Users should not load files under “/internal”

Function: webpack_bundle

Runs the webpack-cli under bazel

Parameters

name
unknown
required
A unique name for this target.
node_modules
unknown
required
Label pointing to the linked node_modules target where webpack is linked, e.g. //:node_modules.The following packages must be linked into the node_modules supplied:webpack, webpack-cli
srcs
unknown
default:"[]"
Non-entry point JavaScript source files from the workspace.You must not repeat file(s) passed to entry_point/entry_points.
args
unknown
default:"[]"
Command line arguments to pass to Webpack.These argument passed on the command line before arguments that are added by the rule. Run bazel with --subcommands to see what Webpack CLI command line was invoked.See the Webpack CLI docs for a complete list of supported arguments.
deps
unknown
default:"[]"
Runtime dependencies which may be loaded during compilation.
chdir
unknown
default:"None"
Working directory to run Webpack under.This is needed to workaround some buggy resolvers in webpack loaders, which assume that the node_modules tree is located in a parent of the working directory rather than a parent of the script with the require statement.Note that any relative paths in your configuration may need to be adjusted so they are relative to the new working directory.See also: https://github.com/aspect-build/rules_js/blob/main/docs/js_binary.md#js_binary-chdir
data
unknown
default:"[]"
Runtime dependencies to include in binaries/tests that depend on this target.The transitive npm dependencies, transitive sources, default outputs and runfiles of targets in the data attribute are added to the runfiles of this target. They should appear in the ‘*.runfiles’ area of any executable which has a runtime dependency on this target.
env
unknown
default:"{}"
Environment variables of the action.Subject to $(location) and make variable expansion.
output_dir
unknown
default:"False"
If True, webpack produces an output directory containing all output files.
entry_point
unknown
default:"None"
The point where to start the application bundling process.See https://webpack.js.org/concepts/entry-points/Exactly one of entry_point to entry_points must be specified if output_dir is False.
entry_points
unknown
default:"{}"
The map of entry points to bundle names.See https://webpack.js.org/concepts/entry-points/Exactly one of entry_point to entry_points must be specified if output_dir is False.
webpack_config
unknown
default:"None"
Webpack configuration file.See https://webpack.js.org/configuration/
configure_mode
unknown
default:"True"
Configure mode in the generated base webpack config.mode is set to production if the Bazel compilation mode is opt otherwise it is set to development.The configured value will be overridden if it is set in a supplied webpack_config.See https://bazel.build/docs/user-manual#compilation-mode for more info on how to configure the compilation mode.
configure_devtool
unknown
default:"True"
Configure devtool in the generated base webpack config.devtool is set to eval if the Bazel compilation mode is fastbuild, eval-source-map if the Bazel compilation mode is dbg, otherwise it is left unset.The configured value will be overridden if it is set in a supplied webpack_config.See https://bazel.build/docs/user-manual#compilation-mode for more info on how to configure the compilation mode.
use_execroot_entry_point
unknown
default:"True"
Use the entry_point script of the webpack js_binary that is in the execroot output tree instead of the copy that is in runfiles.When set, runfiles are hoisted to the target platform when this is configured and included as target platform execroot inputs to the action.Using the entry point script that is in the execroot output tree means that there will be no conflicting runfiles node_modules in the node_modules resolution path which can confuse npm packages such as next and react that don’t like being resolved in multiple node_modules trees. This more closely emulates the environment that tools such as Next.js see when they are run outside of Bazel.
supports_workers
unknown
default:"False"
Experimental! Use only with caution.Allows you to enable the Bazel Worker strategy for this library.
kwargs
unknown
Additional arguments

Function: webpack_devserver

Runs the webpack devserver. This is a macro that uses js_run_devserver under the hood. When using ibazel, the devserver will automatically reload when the source files change. Note that ibazel does not work when using bazel alias targets, see https://github.com/bazelbuild/bazel-watcher/issues/100.

Parameters

name
unknown
required
A unique name for this target.
node_modules
unknown
required
Label pointing to the linked node_modules target where webpack is linked, e.g. //:node_modules.The following packages must be linked into the node_modules supplied:webpack, webpack-cli, webpack-dev-server
chdir
unknown
default:"None"
Working directory to run Webpack under.This is needed to workaround some buggy resolvers in webpack loaders, which assume that the node_modules tree is located in a parent of the working directory rather than a parent of the script with the require statement.Note that any relative paths in your configuration may need to be adjusted so they are relative to the new working directory.See also: https://github.com/aspect-build/rules_js/blob/main/docs/js_binary.md#js_binary-chdir
env
unknown
default:"{}"
Environment variables of the action.Subject to $(location) and make variable expansion.
entry_point
unknown
default:"None"
The point where to start the application bundling process.See https://webpack.js.org/concepts/entry-points/Only one of entry_point to entry_points must be specified.
entry_points
unknown
default:"{}"
The map of entry points to bundle names.See https://webpack.js.org/concepts/entry-points/Only one of entry_point to entry_points must be specified.
webpack_config
unknown
default:"None"
Webpack configuration file. See https://webpack.js.org/configuration/.
configure_mode
unknown
default:"True"
Configure mode in the generated base webpack config.mode is set to production if the Bazel compilation mode is opt otherwise it is set to development.The configured value will be overridden if it is set in a supplied webpack_config.See https://bazel.build/docs/user-manual#compilation-mode for more info on how to configure the compilation mode.
configure_devtool
unknown
default:"True"
Configure devtool in the generated base webpack config.devtool is set to eval if the Bazel compilation mode is fastbuild, eval-source-map if the Bazel compilation mode is dbg, otherwise it is left unset.The configured value will be overridden if it is set in a supplied webpack_config.See https://bazel.build/docs/user-manual#compilation-mode for more info on how to configure the compilation mode.
args
unknown
default:"[]"
Additional arguments to pass to webpack.The serve command, the webpack config file (--config) and the mode (--mode) are automatically set.
data
unknown
default:"[]"
Bundle and runtime dependencies of the program.Should include the webpack_bundle rule srcs and deps.The webpack config and entry_point[s] are automatically passed to data and should not be repeated.
mode
unknown
default:"development"
The mode to pass to --mode.
kwargs
unknown
Additional arguments. See js_run_devserver.