Angular 如何更改ng build index.html的脚本顺序
我在Angular index.html中内联了所有脚本和样式源,以生成单个html文件。我通过运行Angular 如何更改ng build index.html的脚本顺序,angular,typescript,webpack,Angular,Typescript,Webpack,我在Angular index.html中内联了所有脚本和样式源,以生成单个html文件。我通过运行ngbuild--prod来实现这一点,然后使用GruntHTMLSmoosher来解析所有脚本和样式标记。结果实际上是一个包含样式和脚本的HTML文件。 但如果在浏览器中打开它,则会出现以下错误: Uncaught Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwr
ngbuild--prod
来实现这一点,然后使用GruntHTMLSmoosher
来解析所有脚本和样式标记。结果实际上是一个包含样式和脚本的HTML文件。
但如果在浏览器中打开它,则会出现以下错误:
Uncaught Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.
Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)
编辑:
事实上,这个错误可以通过将第三个脚本(polyfills-es5)放在末尾来解决
有人知道如何通过编程或在ng构建完成后使用脚本更改ng构建--prod
的脚本顺序吗
提前谢谢你