-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
PR #6251 generates a HUGE async-vendor
chunk dispite the packages are imported from different async chunks
#6289
Comments
async-vendor
chunk dispite the packages are imported from different async chunksasync-vendor
chunk dispite the packages are imported from different async chunks
Which tool are you using there? I want to try it out locally and see/compare the chunk sizes. |
Just rollup-plugin-visualizer, btw the images are taken from another repo, not the reproduction. |
The critical chunk size may need to be specified for the dynamically imported module, so that the async-vendor is split into different chunks according to the size to avoid excessive chunk size. |
For example, the default minimum chunk size is 200 KB, and the final async-vendor is 500KB, then it will be divided into async-vendor0.js, async-vendor1.js and async-vendor2.js in the end. |
[email protected] was released with #6251 reverted |
Okay,i will propose a more specific splitting strategy for async chunk and create a pr again. |
Describe the bug
PR #6251 introduced a separate chunk for async imports to improve cache hits which is great to have.
The problem is it generates a single chunk for all async imports, which results in all packages imported async-ly to be packed into one huge(in my case >1MB) file.
I think it should be at least keyed chunks so packages from different async chunks will be written separately.
vite v2.7.7:
vite v2.7.8:
Reproduction
https://github.com/QiroNT/vite-reps/tree/vite-6251
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: