-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Problems with the splitVendorChunkPlugin #16268
Labels
Comments
The I think we should remove the mention to it from the docs and deprecate it to be able to completely remove it in Vite 6. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
splitVendorChunkPlugin
not working with entry file fromnode_modules
The nuxt library provides an
entry
file fromnode_modules
. The Vite plugin can't work with this.Expected behavior
Vite generates 2 chunks:
entry
andvendors
.Actual behavior
Vite generates 1
entry
chunk, which contains all dependencies (node_modules
).splitVendorChunkPlugin
adds dependencies that were not in the originalentry
file.Since the plugin performs a recursive search for importers, some dependencies may be marked as statically imported from the
entry
file, although this is not the case. In the example, this can be seen in thedefault
chunk. These dependencies are used only in thedefault
chunk, but they end up in thevendors
chunk.Expected behavior
The
vendors
chunk contains only those dependencies that were present in the originalentry
chunk.Actual behavior
The
vendors
chunk contains dependencies that were not in the originalentry
chunk.Reproduction
https:/alSergey/vite-split-chunks-repro
Steps to reproduce
npx nuxt analyze
After this, default chunks will be generated. The
default
chunk contains dependencies that are used only there.npx nuxt analyze --enable-chunks
After this, chunks will be generated using the
splitVendorChunkPlugin
. Dependencies from thedefault
chunk moved to thevendors
chunk.System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: