Skip to content

Commit

Permalink
Fix Vite critical CSS resolution for route files with absolute paths (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
frandiox authored Apr 3, 2024
1 parent 8838b45 commit 0c0e495
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hot-suits-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Vite: Fix issue resolving critical CSS during development when route files are located outside of the app directory.
2 changes: 1 addition & 1 deletion packages/remix-dev/vite/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const getStylesForUrl = async ({
let appPath = path.relative(process.cwd(), remixConfig.appDirectory);
let documentRouteFiles =
matchRoutes(routes, url, build.basename)?.map((match) =>
path.join(appPath, remixConfig.routes[match.route.id].file)
path.resolve(appPath, remixConfig.routes[match.route.id].file)
) ?? [];

let styles = await getStylesForFiles({
Expand Down

0 comments on commit 0c0e495

Please sign in to comment.