-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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: remove unused SSR CSS files #10686
Conversation
🦋 Changeset detectedLatest commit: 104f19c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This doesn't seem safe to me. I'm not sure that we can know that the CSS is unused on the server. I think if it gets imported from a server file then this will break (#5240). I had an earlier PR to fix the paths when you don't set |
I don't think they're used anywhere because:
The problem now also lies in the difference of filenames as well. I'm not sure what changed but the client css assets are now always named after the nodes such as |
The case I was thinking of would be if you had a
I don't know how likely that is, but it'd also be pretty weird that you can import anything you want into a |
I’ve tested this and the CSS gets inlined as well. Furthermore, this syntax is deprecated by Vite and is equivalent to |
It looks like Svelte 5 will stop outputting CSS in SSR mode. I wonder if we should just wait until then to avoid the extra code complication here |
I agree. I think it's alright to wait until Svelte 5 releases. |
fixes #9161
This PR prevents copying the unused(?) CSS files that are generated from vite's
build.ssrEmitAssets
option. Kit seemingly only uses the client optimised CSS files in the .svelte-kit client bundle, so these server bundle css files shouldn't be copied over.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.