fix(vite): serve css imported in islands (#3272)

Fixes https://github.com/denoland/fresh/issues/3271
This commit is contained in:
Marvin Hagemeister
2025-08-29 14:30:00 +02:00
committed by GitHub
parent b2c4f049bc
commit b41c151de3
14 changed files with 108 additions and 25 deletions
@@ -268,3 +268,24 @@ Deno.test({
sanitizeResources: false,
sanitizeOps: false,
});
Deno.test({
name: "vite dev - island css modules",
fn: async () => {
await launchDevServer(tmp.dir, async (address) => {
await withBrowser(async (page) => {
await page.goto(`${address}/tests/css_modules`, {
waitUntil: "networkidle2",
});
const color = await page
.locator("h1")
// deno-lint-ignore no-explicit-any
.evaluate((el) => window.getComputedStyle(el as any).color);
expect(color).toEqual("rgb(255, 0, 0)");
});
});
},
sanitizeResources: false,
sanitizeOps: false,
});