【问题标题】:I wants to create versioning of angular 4 build --prod--aot我想创建 angular 4 build --prod--aot 的版本控制
【发布时间】:2018-01-30 14:08:07
【问题描述】:

我想创建非常有角度的 4 版本 (ng buid --prod--aot) 的版本。我已经创建了许多版本,但由于浏览器缓存更改没有反映出我们需要用空缓存硬重新加载。

谁能告诉我如何清除缓存

谢谢

【问题讨论】:

  • 另一个问题即将到来 Uncaught SyntaxError: Unexpected token

标签: angular


【解决方案1】:

当您使用 CLI 构建时,您可以使用 output-hashing 作为 true

ng build --aot --output-hashing=true

这将为每个文件名添加一个哈希值,并且对于每个构建都是唯一的

【讨论】:

  • 这里有同样的问题......使用 -aot (dev) 构建工作正常。 Prod 编译时没有抱怨,但是在浏览器上加载应用程序时,它返回以下错误:polyfills.900aaf0d520c2ec873a7.bundle.js:1 Uncaught ReferenceError: webpackJsonp is not defined at polyfills.900aaf0d520c2ec873a7.bundle.js:1 (anonymous) @ polyfills .900aaf0d520c2ec873a7.bundle.js:1 85d3367f26ac4251.bundle.js:1(匿名)@main.dfb485d3367f26ac4251.bundle.js:1
  • 我猜代码有问题,请检查一下
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-20
  • 1970-01-01
  • 1970-01-01
  • 2019-04-06
相关资源
最近更新 更多