我在过渡和生产版本中使用以下配置,
{
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.qa.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
当前,我正在做ng build --configuration qa
作为docker构建步骤的一部分。
这最初会因内存不足问题而失败,我已通过将命令更新为来解决此问题,
node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --configuration qa
为什么仅在Docker上下文中构建会耗尽内存?