After making some changes in my TypeScript files, each build takes over 20 minutes.
I run this command: ng build --output-path=..\\..\\static\\angularjs.
I've found that for me, this issue was solved by using the watch flag, i.e.
ng build --watch=true
This runs constantly, and automatically builds files only when saved. It has dropped my build time from 8 sec to <1 sec for small changes in code, since it only generates .js files for what actually changed.
From https://angular.io/guide/deployment
The
ng buildcommand generates output files just once and does not serve them.The
ng build --watchcommand will regenerate output files when source files change. This--watchflag is useful if you're building during development and are automatically re-deploying changes to another server.
You should probably use ng build with the necessary options when you are building for production so that the necessary optimizations are completed.