How to speed up the Angular build process

前端 未结 6 1810
予麋鹿
予麋鹿 2020-12-23 11:17

After making some changes in my TypeScript files, each build takes over 20 minutes. I run this command: ng build --output-path=..\\..\\static\\angularjs.

<
6条回答
  •  天涯浪人
    2020-12-23 11:47

    You can use node parameter --max_old_space_size like

    node --max_old_space_size=4096 ./node_modules/.bin/ngbuild --prod --build-optimizer
    

    But I prefer to set it up via environment:

    NODE_OPTIONS=--max-old-space-size=4096
    

    It speedup our build process on CI pipeline twice.

提交回复
热议问题