Open SamyZog opened 3 weeks ago
Is this the same as https://github.com/vitejs/vite/issues/14145? It's fixed in the 5.3 beta
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?
when using Nextjs
dynamic
import, it pulls all the library
This sounds like a Next.js bundler concern and I'm not sure how this relates to Vite library mode. Do you know if this issues shows up only for ui library built with Vite?
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