Differential loading script references in index.html different when running ng serve vs. ng build

眉间皱痕 提交于 2019-12-06 08:22:37

After a little more digging I found this discussion on GitHub that indicates differential loading is disabled by default for ng serve and ng build --watch by design. This appears to be done for performance reasons (differential loading requires 2 builds to run, ES5 and non-ES5). There is a workaround to use ES5 bundles instead of the default bundles.

That is the correct behavior of your code .Angular CLi will detect the browser and inject the polyfill script at the runtime like this

So if you are using older browser version you will the script that have nomodule tag

You can read it more here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!