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

support vite 6 #25

Merged
merged 2 commits into from
Dec 8, 2024
Merged

support vite 6 #25

merged 2 commits into from
Dec 8, 2024

Conversation

bluwy
Copy link
Contributor

@bluwy bluwy commented Dec 6, 2024

In Vite 6, CSS in SSR no longer returns a default export of the processed CSS itself. Consumers need to do foobar.css?inline to retrieve that instead. This aligns with the same behaviour in the client-side but Vite had forgot to make the change for SSR, but did so in Vite 6: vitejs/vite#17922

This PR adds support for the virtual CSS to accept ?inline (and any queries in general) to be resolved and loaded. I handled all kinds of queries instead of only ?inline as other queries like ?url could also be useful, or if some plugins want to attach some metadata to the id. But I'm happy to make it strict to handle ?inline only if you prefer so.

Ref withastro/astro#12616

@mayank99
Copy link
Owner

mayank99 commented Dec 8, 2024

Thanks so much for investigating this and submitting a PR! 🙏

I'll run some manual tests tomorrow and make a release after that

@mayank99 mayank99 merged commit bf13b67 into mayank99:main Dec 8, 2024
4 checks passed
@bluwy bluwy deleted the support-vite-6 branch December 8, 2024 06:04
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