Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(remix-dev): fast glob will return posix style paths even on windows #5266

Merged
merged 3 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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