@nrwl/web:webpack
Builds web applications using webpack.
Options can be configured in project.json
when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets.
Options
baseHref
Base url for the application being built.
budgets
[]
Budget thresholds to ensure parts of your application stay within boundaries which you set.
buildLibsFromSource
true
Read buildable libraries from source instead of building them separately.
crossOrigin
The crossorigin
attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'.
compiler
babel
babel
, swc
The compiler to use.
commonChunk
true
Use a separate bundle containing code used across multiple bundles.
deleteOutputPath
true
Delete the output path before building.
deployUrl
URL where the application will be deployed.
extractCss
true
Extract CSS into a .css
file.
es2015Polyfills
Conditional polyfills loaded in browsers which do not support ES2015
.
extractLicenses
false
Extract all licenses in a separate file, in the case of production builds only.
fileReplacements
[]
Replace files with other files in the build.
generateIndexHtml
true
Generates index.html
file to the output path. This can be turned off if using a webpack plugin to generate HTML such as html-webpack-plugin
.
index
HTML File which will be contain the application.
main
The name of the main entry-point file.
memoryLimit
2048
Memory limit for type checking service process in MB
.
maxWorkers
2
Number of workers to use for type checking.
namedChunks
true
Names the produced bundles according to their entry file.
outputPath
The output path of the generated files.
outputHashing
none
none
, all
, media
, bundles
Define the output filename cache-busting hashing mode.
progress
false
Log progress to the console while building.
polyfills
Polyfills to load before application
postcssConfig
Set a path to PostCSS config that applies to the app and all libs. Defaults to undefined
, which auto-detects postcss.config.js files in each app
/lib
directory.
runtimeChunk
true
Use a separate bundle containing the runtime.
sourceMap
true
Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.
scripts
[]
External Scripts which will be included before the main application entry.
styles
[]
External Styles which will be included with the application
subresourceIntegrity
false
Enables the use of subresource integrity validation.
statsJson
false
Generates a 'stats.json' file which can be analyzed using tools such as: 'webpack-bundle-analyzer' or <https://webpack.github.io/analyse>
.
tsConfig
The name of the Typescript configuration file.
vendorChunk
true
Use a separate bundle containing only vendor libraries.
verbose
false
Emits verbose output
watch
false
Enable re-building when files change.
webpackConfig
Path to a function which takes a webpack config, some context and returns the resulting webpack config. See https://nx.dev/guides/customize-webpack