2

目前我在 angular.json 文件中使用“服务”的自定义构建器,像这样

"serve": {
          "builder": "@angular-builders/custom-webpack:dev-server",
          "options": {
            "browserTarget": "app:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "app:build:production"
            },
            "qa": {
              "browserTarget": "app:build:qa"
            },
            "local": {
              "browserTarget": "app:build:local"
            },
}

我也尝试在“本地”中添加构建器选项,但它不起作用,所以有没有办法为“本地服务”添加这个构建器?

4

1 回答 1

0

您可以直接在architect>下添加它build,以便为所有环境启用:

"architect": {
    "build": {
        "builder": "@angular-builders/custom-webpack:browser",
        "options": {
            "customWebpackConfig": {
                "path": "./webpack.config.js",
                "replaceDuplicatePlugins": true
            },
         ....
于 2021-09-07T07:42:28.883 回答