Angular 4 CLI 问题与 IE11 上的 enableProdMode

Angular 4 CLI Issue with enableProdMode on IE11

我使用 Angular 4 CLI 并使用 NodeJS 进行构建。 在开发中,应用程序 运行 在 Internet Explorer 11 和当前 Chrome 以及 Firefox 上正确。

如果我在 NodeJS 构建上添加生产模式,请参阅 package.json 中的示例:

"build": "ng build --prod"

在 IE11 上出现以下错误消息

The IE 11 throws Errors on Console and the Angular App is not working.
Script0511: Code from released script can't be executed
polyfills.<hash>.bundle.js

ERROR Error: Uncaught (in promise): Error: No provider for e!
ERROR TypeError: jt(...) is undefined

我已经为 es6 激活了所有的 polyfill,在浏览器上看不出有什么不同。

Angular Version 4.2.5
core-js 2.5.0 (polyfills)
uglify-js 2.8.29 (file hash)
Internet Explorer 11.1045.10586.0

我想使用生产模式,因为我的名称与 java 重定向上的块文件名有冲突。所以功能生产模式会很棒。

任何指向正确方向的提示、想法都可能有所帮助。

我的 google 搜索给了我以下结果:

angular-2-4-not-working-in-ie11

Github Issue 6695

Gitbub Issue 354

提前致谢

我在 angular 版本 4.3 上发现了一个错误。 这导致 index.html baseurl 的相对路径在 IE 11 上不再工作。 如果我将我的应用程序别名设置为 tomcat,它会再次运行。

我在网上找到的唯一提示是 https://github.com/angular/angular/issues/18176

这个错误不容易发现,并且会导致对 angular 代码进行大量调试。

希望这条消息能帮助其他人,他们的生产系统坏了,而且一直到深夜。