简体   繁体   中英

Angular 5 : ng build — prod freezes the app performances and stability

I'm running under Angular 5.2.9 and angular-cli : 1.6.8

My problem is that when i'm working within dev mode ( ng serve ) , everything is OK , but when running ng build --prod the generated (2.5 mo) app is messy , too slow , and crashes fastly within few clics.

I ve switched to build my app within :

ng build --target=development --env=dev --aot --build-optimizer --sourcemaps=false --named-chunks=true --output-hashing=all --extract-css=false

that resolved my problem of performances , but it's still too heavy (8 mo) and that make the app too heavy in the initial loading.

I was told that i's relative to the gzip of the genereted app.

Is there any way to do the gzip action within ng build --target=developement ?

Update your angular-cli to latest 1.7.3 and recheck the prod build once. I Hope it will work.

on angular/cli v1.7.3 will halt console commands --sourcemap=true , also --buildOptimizer so on 1.6.8 it will work as should. FYI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM