小编tcd*_*ens的帖子

在 v13 的 angular.json 中替换“deployUrl”的最佳方法是什么?

我目前正在将我的应用程序从 v12 升级到 v13,并注意到弹出此警告:

Option "deployUrl" is deprecated: Use "baseHref" option, "APP_BASE_HREF" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url.

在深入研究之后,“baseHref”或 APP_BASE_REF 选项都不适用于我的设置,所以我想知道我是否错误地使用了它们,或者是否没有好的方法来替换它

以下是 angular.json 中的应用程序配置片段:

    "dashboard": {
      "projectType": "application",
      "root": "apps/dashboard",
      "sourceRoot": "apps/dashboard/src",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "allowedCommonJsDependencies": [],
            "outputPath": "../dist/dashboard/",
            "deployUrl": "/dist/dashboard/",
            "index": "apps/dashboard/src/index.html",
            "main": "apps/dashboard/src/main.ts",
            "tsConfig": "apps/dashboard/tsconfig.app.json",
            "polyfills": "apps/dashboard/src/polyfills.ts",
            "styles": [
              "apps/dashboard/src/styles.scss"
            ],
            "scripts": [],
            "stylePreprocessorOptions": {
              "includePaths": [
                "libs/assets/styles"
              ]
            },
            "aot": false,
            "vendorChunk": true,
            "extractLicenses": false, …
Run Code Online (Sandbox Code Playgroud)

configuration json angular angular13

12
推荐指数
2
解决办法
1万
查看次数

标签 统计

angular ×1

angular13 ×1

configuration ×1

json ×1