Heap out of memory in angular4 while ng build --prod

前端 未结 4 1414
时光说笑
时光说笑 2020-12-25 13:39

I am getting an heap out of memory error while ng build --prod ,Is there any work around. its building fine when --aot=false.

Any idea ?

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-25 14:27

    Try running build script in package json by the following script:

    "scripts": {
       "build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod"
    }
    

    Reference

提交回复
热议问题