-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
fix: ignore sideEffects for scripts imported from html #12786
fix: ignore sideEffects for scripts imported from html #12786
Conversation
Run & review this pull request in StackBlitz Codeflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me, but would be great to have tests 😬
Done, thanks for the push ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Let me know when this appears in a beta so I can add it to my PR. thanks for working on this! |
@fregante released in [email protected] |
Success! 38KB
|
Fixes #10735
Description
It seems that adding
moduleSideEffects: false
to scripts imported from .HTML files pushes rollup to tree shake everything. Because"sideEffects": false
is set in the package.json of the app, we end up doing this for every file.This fix works for this reproduction: #10735 (comment)
I don't know if the fix should be more generic though. We could do this as a stop-gap if no one has a better idea here.
What is the purpose of this pull request?