1 | # Webpack Builder for Architect
|
2 |
|
3 | This package allows you to run Webpack and Webpack Dev Server using Architect.
|
4 |
|
5 | To use it on your Angular CLI app, follow these steps:
|
6 |
|
7 | - run `npm install @angular-devkit/build-webpack`.
|
8 | - create a webpack configuration.
|
9 | - add the following targets inside `angular.json`.
|
10 |
|
11 | ```
|
12 | "projects": {
|
13 | "app": {
|
14 | // ...
|
15 | "architect": {
|
16 | // ...
|
17 | "build-webpack": {
|
18 | "builder": "@angular-devkit/build-webpack:webpack",
|
19 | "options": {
|
20 | "webpackConfig": "webpack.config.js"
|
21 | }
|
22 | },
|
23 | "serve-webpack": {
|
24 | "builder": "@angular-devkit/build-webpack:webpack-dev-server",
|
25 | "options": {
|
26 | "webpackConfig": "webpack.config.js"
|
27 | }
|
28 | }
|
29 | }
|
30 | ```
|
31 |
|
32 | - run `ng run app:build-webpack` to build, and `ng run app:serve-webpack` to serve.
|
33 |
|
34 | All options, including `watch` and `stats`, are looked up inside the webpack configuration.
|