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.
Documentation for @aspect_rules_webpack@v0.17.1 — View source
Function: webpack_bundle
Runs the webpack-cli under bazel
Parameters
A unique name for this target.
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-cliNon-entry point JavaScript source files from the workspace.You must not repeat file(s) passed to entry_point/entry_points.
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.Runtime dependencies which may be loaded during compilation.
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
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.Environment variables of the action.Subject to
$(location) and make variable expansion.If True, webpack produces an output directory containing all output files.
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.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 configuration file.See https://webpack.js.org/configuration/
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 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 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.Experimental! Use only with caution.Allows you to enable the Bazel Worker strategy for this library.
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
A unique name for this target.
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-serverWorking 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
Environment variables of the action.Subject to
$(location) and make variable expansion.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.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 configuration file. See https://webpack.js.org/configuration/.
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 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.Additional arguments to pass to webpack.The
serve command, the webpack config file (--config) and the mode (--mode) are
automatically set.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.The mode to pass to
--mode.Additional arguments. See js_run_devserver.

