Angular Universal不适用于angular pwa

时间:2019-04-23 12:16:03

标签: angular angular-universal angular-pwa

我正在尝试构建具有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"
            }
          }
        },
      ...

0 个答案:

没有答案