我正在尝试构建具有pwa和通用功能的有角度的应用程序。我面临的问题是,每当我将serviceWorker
切换到true
时,<app-root></app-root>
内部的HTML内容都不会呈现。
有人可以指出我可能会出问题的地方吗?
angular.json
...
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.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"
}
],
"serviceWorker": false, // setting this to true fails universal rendering
"ngswConfigPath": "src/ngsw-config.json"
}
}
},
...