fix(css): fix inline query injection for CSS inlining #11917
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Fixed how the inline query is injected for CSS inlining.
The previous code injected the inline query at the end and injected unnecessary
=
after queries without values. This was incompatible with plugin-vue resulting in this workaround.astro/packages/astro/src/vite-plugin-astro-server/css.ts
Lines 45 to 49 in 5d7bc70
The new code injects the inline query at the beginning and doesn't inject
=
.This PR also fixes the tests failing with Vite 6 (envrionment API).
https://discord.com/channels/804011606160703521/1278362001437102163/1280816490655907863
I didn't add a changeset because this doesn't change user-facing behavior.
refs #9531
Testing
Updated a test
Docs
N/A since this is a bug fix.