Skip to content

CRA 2 - Dynamic Imports for node_modules #4697

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

Closed
buchanaf opened this issue Jun 28, 2018 · 4 comments
Closed

CRA 2 - Dynamic Imports for node_modules #4697

buchanaf opened this issue Jun 28, 2018 · 4 comments

Comments

@buchanaf
Copy link

buchanaf commented Jun 28, 2018

Question: I have one massive package (aws-amplify) that sits at around 200kb compressed. Is it possible to break this into a separate chunk with dynamic imports? Regardless of what I do, it always ends up in the vendors bundle..

Running 2.0.0-next.3e165448.

@bugzpodder
Copy link

You may want to ask this question in an aws-amplify's dedicated support channel:
eg https://github.com/aws/aws-amplify/issues

@buchanaf
Copy link
Author

aws-amplify was more of an example -- I tried other NPM modules as well with the same result. Basically, I was trying to determine if the current Webpack 4 configuration allowed for excluding large NPM modules from vendors bundle and turning them into their own chunks via dynamic imports.

My vendor.js file is ~roughly 450kb, so I was hoping to break that up.

@bugzpodder
Copy link

bugzpodder commented Jun 29, 2018

I think there are issues with the way vendor modules are bundled currently in 2.0.0-next.3e165448, see #4631 and #4633

@buchanaf
Copy link
Author

Ah thank you, that's exactly what I was looking for. Thanks for taking the time to answer my question! I really appreciate all the work you guys do on this project.

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants