ng build --prod is not generating vendor.bundle.js

冷暖自知 提交于 2019-11-29 06:56:14

For prod builds the vendor bundle is integrated in your main bundle, because it is using the build optimizer per default.

According to the angular-cli documentation:

Total bundle sizes with Build Optimizer are smaller if there is no separate vendor chunk because having vendor code in the same chunk as app code makes it possible for Uglify to remove more unused code.

ng build by default don't generate vendor-chunk but instead it is combined in one main-chunk for performance and optimization purposes, you will need to add a parameter to the build command like so in order to have your vendor-chunk separated:
ng build --prod --vendor-chunk=true

see details here:

https://github.com/angular/angular-cli/wiki/build#--build-optimizer-and---vendor-chunk

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