Skip to content
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

About tree-shaking #376

Closed
jiadesen opened this issue Dec 7, 2023 · 3 comments
Closed

About tree-shaking #376

jiadesen opened this issue Dec 7, 2023 · 3 comments

Comments

@jiadesen
Copy link

jiadesen commented Dec 7, 2023

vitejs/vite#15276 (comment)

@jiadesen
Copy link
Author

jiadesen commented Dec 7, 2023

#363

@sindresorhus
Copy link
Owner

The is a limitation of Vite rather than a problem with this package. Tree-shaking can techincally works with default re-export of named exports, since it can all be statically analysed (one of the benefits of ESM). I suggest opening an issue on Rollup about this as it has to be implemented there.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2023
@jiadesen
Copy link
Author

jiadesen commented Dec 7, 2023

There are already related issues for rollup. Here is an interesting comment about not breaking the default export and making tree-shaking effective. I tested it and it does work.

rollup/rollup#4907 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants