How to speed up the Angular build process
After making some changes in my TypeScript files, each build takes over 20 minutes.
I run this command: ng build --output-path=..\..\static\angularjs
.
If I run it in Microsoft PowerShell, it needs 25 - 30 seconds. This is a lot of time.
Enviroment
- Windows 10
- 8 GB-Ram
- PyCharm 64
- MS PowerShell
How can I speed this up?
Solution 1:
My app took 28secs to build, but I've reduced the time to 9secs. Usings this flag
ng build --source-map=false
you can see the difference in time comparing the time:
ng build --stats-json
ng build --stats-json --source-map=false
source map is intended only for debugging, Hope it helps
Solution 2:
This reduced my build time to 50%
"optimization": false,
"outputHashing": "none",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"showCircularDependencies": false,
"aot": true,
"extractLicenses": false,
"statsJson": false,
"progress": false,
"vendorChunk": true,
"buildOptimizer": false,