arc icon indicating copy to clipboard operation
arc copied to clipboard

The example vendor.js is 590Kb how can we make it smaller?

Open rolele opened this issue 7 years ago • 3 comments

I tried to use you helper splitVendor() to try to split the vendor js (590Kb) into many chunks but I did not succeed. I think the exemple should include this natively (who wants do download 590Kb of js at ones).

I would like to extract vendors: react, redux, and other big ones. I am interested in the redux-ssr branch so there is no js at all that is run on client side when you connect to the website the first time which mean having a lot of chunk and taking advantage of http2 would be a very good thing.

Can you help me with that?

rolele avatar Jun 23 '17 06:06 rolele

Maybe we can add an include on splitVendor?

const bigLibs = ['react', 'redux']
splitVendor({ name: 'vendor1', exclude: bigLibs })
splitVendor({ name: 'vendor2', include: bigLibs })

Not sure if that will work, but I would accept a PR on https://github.com/diegohaz/webpack-blocks-split-vendor

diegohaz avatar Jun 23 '17 12:06 diegohaz

Also, #287 can help optimizing bundle size

diegohaz avatar Jun 23 '17 12:06 diegohaz

Ok thanks, I will have to understand how the commons chunk plugin work first before I could contribute to your package (which is a wrapper around this plugin if I understand well). For now, I am unable to contribute, we will see in the future. I tried to use commons chunk plugin directly on ARC without success so far.

rolele avatar Jun 23 '17 12:06 rolele