Skip to content

Commit 7eae789

Browse files
committed
fix: render merged CSS when cssCodeSplit is false
Refs: #1324
1 parent 73f49b3 commit 7eae789

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/start/src/server/handler.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,13 @@ export async function createPageEvent(ctx: FetchEvent) {
154154
// const prevPath = ctx.request.headers.get("x-solid-referrer");
155155
// const mutation = ctx.request.headers.get("x-solid-mutation") === "true";
156156
const manifest = getSsrManifest(import.meta.env.SSR && import.meta.env.DEV ? "ssr": "client");
157+
158+
// Handle Vite build.cssCodeSplit
159+
// When build.cssCodeSplit is false, a single CSS file is generated with the key style.css
160+
const mergedCSS = import.meta.env.PROD ? await manifest.getAssets('style.css'): [];
161+
157162
const assets = [
163+
...mergedCSS,
158164
...(await manifest.getAssets(import.meta.env.START_CLIENT_ENTRY)),
159165
...(await manifest.getAssets(import.meta.env.START_APP_ENTRY)),
160166
// ...(import.meta.env.START_ISLANDS

0 commit comments

Comments
 (0)