angular8 打包時 文件過大 導致內存溢出解決方案(記錄)


在package.json 中添加

"scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "buildTest": "ng build --build--optimizer --aot ",
    "buildProd":"node --max-old-space-size=8000 node_modules\\@angular\\cli\\bin\\ng build --prod --build--optimizer --aot",
    "e2e": "ng e2e"
  },

  

"buildProd":"node --max-old-space-size=8000 node_modules\\@angular\\cli\\bin\\ng build --prod --build--optimizer --aot",

使用
npm run buildProd


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM