当angular.json中的sourceMap为true时,ng build --prod失败

时间:2018-12-07 01:31:26

标签: angular angular6 angular-cli

我正在使用angular 6和angular-cli版本6.2.7。

当我在ng.json配置中使用带有sourceMap:false的ng build --prod执行生产构建时,没有问题。但是当我使用sourceMap:true时,会出现此错误

enter image description here

这是我的其他详细信息

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:2)

作为解决方法,您可以尝试指定max_old_space_size设置(以MB为单位)

node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --prod

相关问题