Skip to content

Commit

Permalink
fix(remix-dev): fast glob will return posix style paths even on windo…
Browse files Browse the repository at this point in the history
…ws (#5266)
  • Loading branch information
mcansh authored Jan 26, 2023
1 parent 4edd740 commit 4351ffe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .changeset/hip-cats-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"remix": patch
"@remix-run/dev": patch
---

fix flat routes on windows, so that it picks up new files and renames

fast glob will return posix style paths even on windows
8 changes: 7 additions & 1 deletion packages/remix-dev/config/flat-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ export function flatRoutes(
ignore: ignoredFilePatterns,
});

return flatRoutesUniversal(appDirectory, routePaths);
// fast-glob will return posix paths even on windows
// convert posix to os specific paths
let routePathsForOS = routePaths.map((routePath) => {
return path.join(...routePath.split(path.posix.sep));
});

return flatRoutesUniversal(appDirectory, routePathsForOS);
}

interface RouteInfo extends ConfigRoute {
Expand Down

0 comments on commit 4351ffe

Please sign in to comment.