How to Reduce Vendor/Script Bundle.Js in Angular 5

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

This file includes all libraries that you added into your project. If you build your app on production mode the file size will be smaller.

ng build --prod

Vendor Bundle Size Not Reducing

Remove libraries like ngx-spinner, filepond etc. which are huge as they are not treeshakable. Also if you have not configured your server to serve gzip files, do that. It will give you huge reduction in size. Also pre gzip your js files after build my using a utility like gzip-all.

https://www.npmjs.com/package/gzip-all

Also change your server max cache policy to get caching benefits.



Related Topics



Leave a reply



Submit