ionic build 在 ionic build --prod 之后卡在了巨大的项目中

Ionic build stuck after ionic build --prod in huge project

我正在开发一个包含大量页面和组件的 PWA。

当我执行 ionic build --prod 时,ionic 开始构建,但它在显示后卡住了 copy finished

我如何构建用于生产的 PWA?

通过将 package.json 更改为

解决
  "config": {
    "ionic_source_map": "source-map",
    "ionic_source_map_type": "cheap-source-map"
  },

 "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "node --max-old-space-size=4096 ./node_modules/@ionic/app-scripts/bin/ionic-app-scripts.js build",
    "ionic:serve": "ionic-app-scripts serve"
  },

Obs.: 在配置中,真正重要的是 "ionic:build"