Sunday, July 22, 2018

92% chunk asset optimization

We struggled a lot with fixing this issue while publishing Angular in production mode.
Following things to do fix 92% chunk asset optimization issue in production mode
1. Update your nodejs version to latest. (https://nodejs.org/en/download/)
2.Install Angular/Cli

 npm uninstall -g angular-cli
npm cache clean or npm cache verify (if npm > 5)
npm install -g @angular/cli@latest
3.Update Angular/Cli
ng update @angular/cli


Then Try, if it was taking 110 minutes, after the update it's reduced to less then 2 minutes its reduced around 90%

Before the update, with Dev mode main file is 23 MB and --prod mode 6MB
After update, the dev mode main file is 9MB and --Prod mode 6MB