Vinh Do
Vinh Do

Reputation: 51

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.

Upvotes: 5

Views: 4826

Answers (2)

Pac0
Pac0

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

HannaAB
HannaAB

Reputation: 23

you can limit the ram usage like

node --max_old_space_size=400 ng build

Upvotes: 0

Related Questions