-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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 bug] sideEffects
doesn't seem to be working correctly
#7635
Comments
Additional informationThese lines of code may be related: vite/packages/vite/src/node/packages.ts Lines 97 to 105 in 7186857
But it seems to have done the right thing. |
I think this behavior is correct.
If you intend not to include highlight.js languages automatically I think you should import |
On the contrary, we intend to include them. The problem is they are removed unexpectedly |
Sorry I misread it. |
I have found that changing either of below will make it not occur.
So I think it is related to re-exporting. |
I was able to reproduct only with rollup. |
Thanks for investigating it! I'm not sure if Rollup respects the |
I feel rollup is incorrectly treating |
Fix at rollup/rollup#4867 |
Thanks! Closing as rollup 3.17.2 that includes the fix was released. |
Describe the bug
When importing the package
lowlight
, some parts of the code in files listed atsideEffects
are removed incorrectly:https://github.com/wooorm/lowlight/blob/0803fc3416cbdf59f204da243313e3315eb34617/lib/common.js#L1-L36
Reproduce steps
npm run build
highlight.js
languages code bundled inReproduction
https://stackblitz.com/edit/vitejs-vite-zyomf8?file=main.js
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: