@@ -59,10 +59,34 @@ ng build --base-href /myUrl/
59
59
ng build --bh /myUrl/
60
60
```
61
61
62
- ### Bundling
63
-
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.
62
+ ### Bundling & Tree-Shaking
63
+
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
+ ` --dev ` :
73
+ - ` --aot ` is set to ` false ` .
74
+ - ` --environment ` is set to ` dev ` .
75
+ - ` --output-hashing ` is set to ` media ` .
76
+ - ` --sourcemaps ` is set to ` true ` .
77
+ - ` --extract-css ` is set to ` false ` .
78
+
79
+ ` --prod ` :
80
+ - ` --aot ` is set to ` true ` .
81
+ - ` --environment ` is set to ` prod ` .
82
+ - ` --output-hashing ` is set to ` all ` .
83
+ - ` --sourcemaps ` is set to ` false ` .
84
+ - ` --extract-css ` is set to ` true ` .
85
+
86
+ ` --prod ` also sets these non-flaggable settings:
87
+ - Adds service worker if configured in ` .angular-cli.json ` .
88
+ - Replaces ` process.env.NODE_ENV ` in modules with the ` production ` value (this is needed for some libraries, like react).
89
+ - Runs UglifyJS on the code.
66
90
67
91
## Options
68
92
<details >
0 commit comments