Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rolele opened this issue Jun 23, 2017 · 3 comments
Open

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

rolele opened this issue Jun 23, 2017 · 3 comments

Comments

@rolele
Copy link

rolele commented Jun 23, 2017

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 rolele changed the title The example client.js is 590Kb how can we make it smaller? The example vendor.js is 590Kb how can we make it smaller? Jun 23, 2017
@diegohaz
Copy link
Owner

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
Copy link
Owner

Also, #287 can help optimizing bundle size

@rolele
Copy link
Author

rolele commented Jun 23, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants