fix(vite): support ssr css modules (#3355)

Fixes https://github.com/denoland/fresh/issues/3325
This commit is contained in:
Marvin Hagemeister
2025-09-08 16:23:13 +02:00
committed by GitHub
parent 4c3ff9b74d
commit 2c32ffe8f3
11 changed files with 520 additions and 270 deletions
+8 -1
View File
@@ -328,7 +328,7 @@ Deno.test({
});
Deno.test({
name: "vite build - island css modules",
name: "vite build - css modules",
fn: async () => {
await launchProd(
{ cwd: viteResult.tmp },
@@ -355,6 +355,13 @@ Deno.test({
// deno-lint-ignore no-explicit-any
.evaluate((el) => window.getComputedStyle(el as any).color);
expect(color).toEqual("rgb(0, 0, 255)");
// Route css
color = await page
.locator(".route > h1")
// deno-lint-ignore no-explicit-any
.evaluate((el) => window.getComputedStyle(el as any).color);
expect(color).toEqual("rgb(255, 218, 185)");
});
},
);