-
Notifications
You must be signed in to change notification settings - Fork 92
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
Importing one component in library mode imports all #55
Comments
Logged this bug today with rollup-plugin-vue, which addresses tree-shaking. The bug you referred to was for vue2, and had been resolved. It seemed to crop up again recently, due partially to upstream changes. Just released v4.0.0-beta.1 which in my latest tests is very tree-shakeable for vue2, but not vue3 at all. The bug I logged illustrates that the tree-shaking issues are not due to this utility, since all it does is scaffold the config - the actual output is from rollup-plugin-vue. The bug includes a sample repo showing the exact same code/config creating vastly different tree-shakability results between vue2 and vue3. You'll probably want to keep an eye on that bug report - when it gets resolved, there should be no need to change this utility unless rollup-plugin-vue gets a semver-major update as part of the fix. |
Great, thanks for taking a look! |
Updated my bug report just the other day with addl. research regarding tree-shaking in Vue 3 version. Still an upstream problem, but at least there is more info an a very manual workaround. |
The decision has been made to deprecate |
Thanks for the tool, it really helped me get up and running with our component library for Vue 3!
I'm not sure if this is something to do with how the library is generated, or how Vite is building the final app, but I'm using
4.0.0-beta.0
for a Vue 3 library used in a Vue 3 project, which is built with Vite, and I noticed that tree shaking for the output library doesn't seem to work. I saw #39 but I'm not sure if that's the same issue.I'm importing the
esm
version, and we have around 91 helper components. It seems like importing one or more of the components into the app - e.g.import { SimpleDonut } from '@software2-libraries/ui-components';
takes the built file from 50k to 500k, and it doesn't matter how many components I try to import.The text was updated successfully, but these errors were encountered: