How to speed up the Angular build process

michael-mammut picture michael-mammut · Jul 21, 2017 · Viewed 70.8k times · Source

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?

Answer

Mauricio De La Quintana picture Mauricio De La Quintana · Jul 21, 2017

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