File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,30 @@ ng build --bh /myUrl/
64
64
All builds make use of bundling, and using the ` --prod ` flag in ` ng build --prod `
65
65
or ` ng serve --prod ` will also make use of uglifying and tree-shaking functionality.
66
66
67
+ ** Note:** It is not recommended using ` [class].constructor.name ` while using the
68
+ ` --prod ` build flag. Since the name of the class will be uglified.
69
+ #### Example
70
+ ``` js
71
+ // Outputing router events to log
72
+ router .events .map (event => console .log (event .constructor .name ));
73
+
74
+ // Output without --prod flag:
75
+ // NavigationStart
76
+ // RoutesRecognized
77
+ // NavigationEnd
78
+
79
+ // With --prod flag:
80
+ // t
81
+ // v
82
+ // c
83
+ ```
84
+
85
+ #### Difference between building with or without ` ---prod ` flag
86
+ | | With | Without |
87
+ | --------------| :----:| :-------:|
88
+ | Tree-shaking | x | x |
89
+ | Uglifying | x | |
90
+
67
91
## Options
68
92
` --watch ` (` -w ` ) rebuild when files change
69
93
You can’t perform that action at this time.
0 commit comments