How to decrease size of vendor.js in angular 2,4,6,7,8,9,10? How to decrease size of vendor.js in angular 2,4,6,7,8,9,10? angular angular

How to decrease size of vendor.js in angular 2,4,6,7,8,9,10?


You mean how to decrease? This file includes all libraries that you added into your project.If you build your app on production mode it'll be much lower.

ng build --prod

If it's not your answer, explain more what you are looking for.


Try

ng build --prod --aot --vendor-chunk --common-chunk --delete-output-path --buildOptimizer

I reduced my vender.**.js fromm 12mb to 2mb


Instead of decreasing it you can remove the file completelyBy specifying the --build-optimizer flag, the cli will disable this file from the build output.

The CLI will now bundle the vendor code into the main.js bundle, which will also enable uglification to reduce the size.

So you will see a small increase in the size of the main.js bundle which is minimal in comparison to the size of the vendor chunks