Reputation: 21
According to devops the ng build --prod command is taking to high cpu usage that why our server costing is increase. I don't know how i optimize this build process, but i have doubt when i run my ng build command on locally and on the server the console output is different.
prod console.:
⠋ Generating browser application bundles (phase: setup)... [2K [1G⠙ Generating browser application bundles (phase: building)... [2K [1G⠹ Generating browser application bundles (phase: building)... [2K [1G⠸ Generating browser application bundles (phase: building)... [2K [1G⠼ Generating browser application bundles (phase: building)... [2K [1G⠴ Generating browser application bundles (phase: building)... [2K [1G⠦ Generating browser application bundles (phase: building)... [2K [1G⠧ Generating browser application bundles (phase: building)... [2K [1G⠇ Generating browser application bundles (phase: building)... [2K [1G⠏ Generating browser application bundles (phase: building)... [2K [1G⠋ Generating browser application bundles (phase: building)... [2K [1G⠙ Generating browser application bundles (phase: building)... [2K [1G⠹ Generating browser application bundles (phase: building)... [2K [1G⠸ Generating browser application bundles (phase: building)... [2K [1G⠼ Generating browser application bundles (phase: building)... [2K [1G⠴ Generating browser application bundles (phase: building)... [2K [1G⠦ Generating browser application bundles (phase: building)... [2K [1G⠧ Generating browser application bundles (phase: building)... [2K [1G⠇ Generating browser application bundles (phase: building)... [2K [1G⠏ Generating browser application bundles (phase: building)... [2K [1G⠋ Generating browser application bundles (phase: building)... [2K [1G⠙ Generating browser application bundles (phase: building)... [2K [1G⠹ Generating browser application bundles (phase: building)... [2K [1G⠸ Generating browser application bundles (phase: building)... [2K [1G⠼ Generating browser application bundles (phase: building)... [2K [1G⠴ Generating browser application bundles (phase: building)... [2K [1G⠦ Generating browser application bundles (phase: building)... [2K [1G⠧ Generating browser application bundles (phase: building)... [2K [1G⠇ Generating browser application bundles (phase: building)... [2K [1G⠏ Generating browser application bundles (phase: building)... [2K [1G⠋ Generating browser application bundles (phase: building)... [2K [1G⠙ Generating browser application bundles (phase: building)... [2K [1G⠹ Generating browser application bundles (phase: building)... [2K [1G⠸ Generating browser application bundles (phase: building)...
Local console:
Generating browser application bundles (phase: setup)...Compiling @angular/core : es2015 as esm2015
In both console has difference is, on production the generating browser application... this line call many times but on local this is call only single time then bundle process is starting.
where is the gap in ng build command on local env and server env
Upvotes: 2
Views: 899
Reputation: 97120
The multiple lines in the server output are just due to the fact that the server log doesn't know how to deal with the animated progress character that is displayed in the console.
For the server build, just disable the progress reporting:
ng build --no-progress --prod
Upvotes: 2