Skip to content

Commit

Permalink
chore: fix Windows path normalization in Vite (remix-run#8806)
Browse files Browse the repository at this point in the history
Co-authored-by: Pedro Cattori <[email protected]>
  • Loading branch information
AlemTuzlak and pcattori authored Feb 20, 2024
1 parent 17a3cc2 commit 9cb876f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/long-walls-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@remix-run/dev": patch
---

Vite: reliably detect non-root routes in Windows

Sometimes route `file` will be unnormalized Windows path with `\` instead of `/`.
2 changes: 1 addition & 1 deletion packages/remix-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ function getRoute(
path.relative(pluginConfig.appDirectory, file)
);
let route = Object.values(pluginConfig.routes).find(
(r) => r.file === routePath
(r) => vite.normalizePath(r.file) === routePath
);
return route;
}
Expand Down

0 comments on commit 9cb876f

Please sign in to comment.