Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何更改ng build index.html的脚本顺序_Angular_Typescript_Webpack - Fatal编程技术网

Angular 如何更改ng build index.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

我在Angular index.html中内联了所有脚本和样式源,以生成单个html文件。我通过运行
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
的脚本顺序吗

提前谢谢你