-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
vite 6 potential bundle size regression (CJS, ESM) #18861
Comments
Summary: It's not a bug, and is actually a bug fix. The library should add In Vite 5.x, there was a bug that mixed the cache of require resolution and import resolution and Vite 6 fixed that. While this is a more correct behavior, dual package hazard happens a bit more frequently (it won't happen if the package author writes a proper For example, in this project, in Vite 6 The two import / require paths are:
In Vite 5, the resolution cache was mixed so The way to fix this is to add |
Some issues related to the |
Thanks for looking into this and for the careful explanation. 👏🏼 NOTE: upgrading the library also solved the issue, just wanted to flag if this was in fact a regression in Vite 6 |
Describe the bug
When using the prosemirror-utils dependency the vite@6 bundle ends up 20% bigger than vite@5 – due to ESM and CJS ending up in the same bundle (see stats-vite5.html and stats-vite6.html).
Removing the prosemirror-utils dependency fixes the problem, but question is, can this be considered a vite 6 bundle size regression – or just a bug in the library definition?
Reproduction
https://github.com/skovhus/vite6-bundle-size-regression
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: