Reputation: 51
when i run command npm run build, ng command use a lot cpu
how to fix it, sorry for my english and thanks for watching.
Upvotes: 5
Views: 4826
Reputation: 23139
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.
Upvotes: 3
Reputation: 23
you can limit the ram usage like
node --max_old_space_size=400 ng build
Upvotes: 0