-
-
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
adapter-static SPA build output includes server / ssr css files #9161
Comments
Related to #9073 . Perhaps we need some way to tell the builder to only copy client assets, rather than copying both over. In some cases the double CSS output is also caused by Vite not minifying the server CSS, using a different hash name for the same file, creating a duplicate. But sometimes, the CSS content really is different and will result in two files being copied over (with the server one unused). |
i'm currently running into the same issue. is the only current workaround to manually remove the SSR files? and if that's the case, how can I tell which output is SSR and which is client? at first, i thought there was probably no difference, but @s3812497 's comment seems to suggest there are cases where there are actually two different CSS files generated? the only difference in my case is that mine isn't a SPA -- i'm just trying to build a single, static page (so i'm exporting it also seems like there are two |
You can try adding the config option below and see if it helps. This should reduce the duplicate CSS files until #9382 or otherwise is merged // svelte.config.js
export const config = {
kit: {
build: {
minify: 'esbuild'
}
}
} |
With the duplicate CSS issue fixed in #9382 kit/packages/kit/src/core/adapt/builder.js Lines 185 to 192 in 9aded81
|
How do we end up with different server/client CSS now that #9382 has been merged? |
The URL paths in the CSS are resolved differently for server and client (absolute vs relative). This can be reproduced by building the demo app. |
I'm also wondering this. I just want client files created. |
So, this is closed (and I found the same problem, so posted a duplicate bug, with quite some effort put into it). Is this not gonna be fixed? I mean, I'm singing svelte praises compared to other UI systems, but other devs are bound to call this out |
I just stumbled upon this issue. |
Describe the bug
Hi,
Building an SPA using svelte kit,
adapter-static
,ssr = false
,csr = true
,prerender == false
, results in both the server / ssr.css
and client-side.css
files to be written tobuild/_app/immutable/assets/
.I would expect the server css not to be there, given the intention of creating an SPA.
This effectively doubles the amount of CSS that will be embedded into the resources of a non-nodejs binary (e.g golang/rust binary) that serves the SPA files.
It would be great if the server files are not written to the build folder, to avoid removing them after each build either manually or with some post-processing step.
Reproduction
Create skeleton project using
npm create svelte@latest demo
Modify svelte.config.js
Create +layout.ts with contents
+layout.svelte contents
styles.css
run
npm run build
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: