打开 angular.json -> projects -> 项目名 -> architect -> build -> configurations -> production。复制该配置以设置更多的配置项

更改对应的配置文件路径

"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]

 

分别执行: ng s -c=dev 与 ng s -c=prod 与 ng s,会看到不同的结果:devprodtest

在发布时,需要将命令稍作修改: ng build --prod -c=prod

相关文章:

  • 2021-06-09
  • 2021-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-04-06
  • 2022-12-23
  • 2021-07-31
相关资源
相似解决方案