-
Notifications
You must be signed in to change notification settings - Fork 27
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 / code splitting #488
Comments
Can you share a reproduction with both library and your next.js code? It has few factors that could effect the tree-shaking |
Sorry for the late reply. Sure here is the library repo: https://github.com/lovrozagar/renderui-core/blob/main/package.json and nextjs starter with one import to showcase the issue: https://github.com/lovrozagar/bunchee-treshake-reproduction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am building a component library for Next.js, using bunchee to compile but when using only one component out of many in the consumer app, my whole library is included in the built app bundle size. Looking at the build file that bunchee generates for the component library, code is split into many smaller files, I am using "use client" directive somewhere and those components are separate files too.
Maybe I am missing something. It would be good to note what is needed for tree shaking in the docs as I am unable to find more info on this topic.
The text was updated successfully, but these errors were encountered: