-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Tree shaking dynamic import from VIte bundled React component library #17460
Comments
Is this the same as #14145? It's fixed in the 5.3 beta |
I am not sure if this is related, correct me if I am wrong, as I understood the mentioned issue talks about building the final bundle, that uses the library, with Vite. Maybe my issue is a configuration issue? |
This sounds like a Next.js bundler concern and I'm not sure how this relates to Vite library mode. They seem to have this https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#with-named-exports, but either way, this seems more of Next.js side inconsistency (static named import vs dynamic named import), so you should probably look for help there. |
Describe the bug
I am building a private React component library using Vite, I am using a barrel file for all my exports.
The library is private and I am using it inside my company's internal repo using
git+http
Directly importing my components works fine, every module is tree-shaked, but when using Nextjs
dynamic
import, it pulls all the libraryThis is my vite config
Reproduction
N/A
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: