From 205e0f4cbc41d75ba615cbd70b905d035dc066ee Mon Sep 17 00:00:00 2001 From: Daniel Choudhury Date: Tue, 21 Nov 2023 12:57:19 +0700 Subject: [PATCH] fix(streaming): Fix css loading on dev server on Windows (#9557) --- packages/vite/src/streaming/collectCss.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/streaming/collectCss.ts b/packages/vite/src/streaming/collectCss.ts index 67fe1454364f..cbaa7bff2f6d 100644 --- a/packages/vite/src/streaming/collectCss.ts +++ b/packages/vite/src/streaming/collectCss.ts @@ -1,4 +1,5 @@ import type { ViteDevServer, ModuleNode } from 'vite' +import { normalizePath } from 'vite' /** * Collect SSR CSS for Vite @@ -9,7 +10,7 @@ export const componentsModules = ( ) => { const matchedModules: Set = new Set() components.forEach((component) => { - const modules = vite.moduleGraph.getModulesByFile(component) + const modules = vite.moduleGraph.getModulesByFile(normalizePath(component)) modules?.forEach((mod) => { matchedModules.add(mod) })