Skip to content

feat: scope css to js module to allow treeshaking it (requires vite 6.2) #1092

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

dominikg
Copy link
Member

@dominikg dominikg commented Mar 2, 2025

see vitejs/vite#19418

This allows vite to treeshake unused svelte component css if the component was referenced in a barrel file.

@dominikg
Copy link
Member Author

the regex approach is a bit less clunky i think. least clunk inside vps would be an option that allows users to define the tests themselves on filename+content, similar to dynamicCompileOptions.

@dominikg
Copy link
Member Author

reninder to self: switch to css.hasGlobal sveltejs/svelte#15450 (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

Successfully merging this pull request may close these issues.

2 participants