Skip to content

Commit cf09564

Browse files
authored
Fix Vite critical CSS resolution when cwd differs from project root (#8752)
1 parent c907dc5 commit cf09564

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/remix-dev/vite/styles.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ const getStylesForFiles = async ({
3737

3838
try {
3939
for (let file of files) {
40-
let normalizedPath = path.resolve(file).replace(/\\/g, "/");
40+
let normalizedPath = path
41+
.resolve(rootDirectory, file)
42+
.replace(/\\/g, "/");
4143
let node = await viteDevServer.moduleGraph.getModuleById(normalizedPath);
4244

4345
// If the module is only present in the client module graph, the module

0 commit comments

Comments
 (0)