-
-
Notifications
You must be signed in to change notification settings - Fork 106
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 the direct
query param
#341
Comments
👍 So requesting the css via direct link before the .svelte file was imported won't work right now.
Right now i prefer solution 1) as it is the least amount of work. |
Thanks, I think this makes sense to me. For what it's worth, Astro does not add |
If you always import Can be done in separate PRs to keep the diffs small. |
@matthewp is this still something you need/miss? |
Describe the problem
In Astro we prefer to add
<link>
tags per component for styles in development mode. This works because Vite will detect a request that has been added via link tag through the Accept header and then injects thedirect
query param.For Astro and Vue styles this works because those Vite plugins do not modify the id. Since Svelte creates an id the
direct
param gets lost.This means that we cannot use
<link>
in dev for Svelte, but rather must use a module script which results in a FOUC (flash of unstyled content).Describe the proposed solution
When generating the
cssId
, preservedirect
query param, if it's included in the importee.vite-plugin-svelte/packages/vite-plugin-svelte/src/utils/id.ts
Line 52 in a6a8e00
Alternatives considered
No alternatives that I am aware of, other than Astro continuing to use
<script>
and live with the FOUC.Note that I am willing to submit a PR for this.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: