Skip to content

Commit

Permalink
Fix Vite critical CSS resolution when cwd differs from project root (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
frandiox committed Feb 15, 2024
1 parent c907dc5 commit cf09564
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/remix-dev/vite/styles.ts
Expand Up @@ -37,7 +37,9 @@ const getStylesForFiles = async ({

try {
for (let file of files) {
let normalizedPath = path.resolve(file).replace(/\\/g, "/");
let normalizedPath = path
.resolve(rootDirectory, file)
.replace(/\\/g, "/");
let node = await viteDevServer.moduleGraph.getModuleById(normalizedPath);

// If the module is only present in the client module graph, the module
Expand Down

0 comments on commit cf09564

Please sign in to comment.