File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,28 @@ ng build --base-href /myUrl/
5959ng build --bh /myUrl/
6060```
6161
62- ### Bundling
62+ ### Bundling & Tree-Shaking
6363
64- All builds make use of bundling, and using the ` --prod ` flag in ` ng build --prod `
65- or ` ng serve --prod ` will also make use of uglifying and tree-shaking functionality.
64+ All builds make use of bundling and limited tree-shaking, while ` --prod ` builds also run limited
65+ dead code elimination via UglifyJS.
66+
67+ ### ` --dev ` vs ` --prod ` builds
68+
69+ Both ` --dev ` /` --target=development ` and ` --prod ` /` --target=production ` are 'meta' flags, that set other flags.
70+ If you do not specify either you will get the ` --dev ` defaults.
71+
72+ Flag | ` --dev ` | ` --prod `
73+ --- | --- | ---
74+ ` --aot ` | ` false ` | ` true `
75+ ` --environment ` | ` dev ` | ` prod `
76+ ` --output-hashing ` | ` media ` | ` all `
77+ ` --sourcemaps ` | ` true ` | ` false `
78+ ` --extract-css ` | ` false ` | ` true `
79+
80+ ` --prod ` also sets the following non-flaggable settings:
81+ - Adds service worker if configured in ` .angular-cli.json ` .
82+ - Replaces ` process.env.NODE_ENV ` in modules with the ` production ` value (this is needed for some libraries, like react).
83+ - Runs UglifyJS on the code.
6684
6785## Options
6886<details >
You can’t perform that action at this time.
0 commit comments