@nrwl/webpack: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/reference/project-configuration#targets.
project.json
:
//...
"my-app": {
"targets": {
//...
"build": {
"executor": "@nrwl/webpack:webpack",
//...
//...
"options": {
...
},
//...
}
},
}
}
nx build my-app
Examples
You can configure Webpack using a webpack.config.js
file. If you do so, you can set the path to this file in your project.json
file, in the build
target options:
//...
"my-app": {
"targets": {
//...
"build": {
"executor": "@nrwl/webpack:webpack",
//...
"options": {
//...
"webpackConfig": "apps/my-app/webpack.config.js"
},
"configurations": {
...
}
},
}
}
Read more on how to configure Webpack in the Nx Webpack configuration guide.