Angular的fileReplacements只在ngserve中有效,而在ngbuild中无效。
创始人
2024-10-24 03:00:55
0

为了在ng build中也能使用fileReplacements,需要在angular.json中进行配置。例如,为了替换一个名为“environment.ts”的文件,在“build”部分中的“configurations”中添加一个新的“production”环境,并'fileReplacements”设置为所需的文件路径,如下所示:

 "configurations": {
    "production": {
      "fileReplacements": [
        {
          "replace": "src/environments/environment.ts",
          "with": "src/environments/environment.prod.ts"
        }
      ],
      // Other production configuration options...
    }
}

然后运行“ng build --configuration=production” 就能够在构建时使用fileReplacements了。

相关内容

热门资讯

透视好友!wepoker透视版... 透视好友!wepoker透视版下载,wepoker脚本下载(透视)技巧教程(有挂详情)1、透视好友!...
透视黑科技!we-poker辅... 透视黑科技!we-poker辅助软件教程,wepoker手机插件(透视)必备教程(有挂攻略)1、we...
透视规律!wepoker有人用... 透视规律!wepoker有人用过吗,wepoker透视破解版(透视)解密教程(有挂插件)1、下载好w...
透视辅助!wepoker免费脚... 透视辅助!wepoker免费脚本弱密码,wepoker怎么拿到好牌(透视)安装教程(有挂介绍)1.w...
透视科技!we poker辅助... 透视科技!we poker辅助器,wepoker辅助插件功能(透视)第三方教程(有挂介绍)1、超多福...
透视安卓版!wepoker免费... 透视安卓版!wepoker免费脚本咨询,wepoker有没有挂(透视)透明教程(有挂脚本)1、wep...
透视教程!wepoker怎么设... 透视教程!wepoker怎么设置盖牌,wepoker提高好牌率(透视)曝光教程(有挂脚本)1、进入到...
透视讲解!购买wepoker模... 透视讲解!购买wepoker模拟器,wepoker辅助工具(透视)大神讲解(有挂揭秘);1、构建自己...
透视讲解!wepoker插件功... 透视讲解!wepoker插件功能辅助器,wepoker轻量版透视系统(透视)揭秘教程(有挂工具);1...
透视教程!wepoker透视功... 透视教程!wepoker透视功能下载,wepoker私人定制透视(透视)攻略方法(有挂介绍)一、we...