Angular-cli指定生产环境的文件名

时间:2017-07-18 15:56:42

标签: angular

Angular在运行ng build --prod时为文件生成随机名称。 有没有办法指定我们想要的名称?我们正在使用angular-cli。我们确实需要这个,因为我们的角度应用程序嵌入在CMS平台中。

1 个答案:

答案 0 :(得分:17)

我想你可以。

  • 使用像inline.bundle.js这样的标准名称 vendor.bundle.js,main.bundle.js这是在开发模式下启用的,但是如果你想在prod模式下使用这些名称。在你的情况下,

    ng build --prod
    

    您可以使用以下标志来避免散列

     ng build --prod --output-hashing none
    

    更多信息https://github.com/angular/angular-cli/wiki/build

相关问题