简体   繁体   中英

NPM run build over 100% cpu

when i run command npm run build, ng command use a lot cpu

1

how to fix it, sorry for my english and thanks for watching.

The fact that the production build uses a lot of your CPU is a good sign, it means that the production build is effectively trying to do the proper optimizations.

For development purposes, when you want the build to be much quicker, you should switch to a non-prod build

See your packages.json file, but essentially you should create or look for a build-dev script that calls ng build without --prod option.

you can limit the ram usage like

node --max_old_space_size=400 ng build

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