Skip to content

Commit

Permalink
fix(remix-dev): normalize path before testing if it is a route entry (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh authored May 3, 2023
1 parent 16cfda8 commit acdd7c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/light-bikes-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"remix": patch
"@remix-run/dev": patch
---

normalize file paths before testing if a changed file is a route entry
4 changes: 3 additions & 1 deletion packages/remix-dev/compiler/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { type Manifest } from "../manifest";
import * as Compiler from "./compiler";
import type { Context } from "./context";
import { logThrown } from "./utils/log";
import { normalizeSlashes } from "../config/routes";

function isEntryPoint(config: RemixConfig, file: string): boolean {
let appFile = path.relative(config.appDirectory, file);
Expand All @@ -16,7 +17,8 @@ function isEntryPoint(config: RemixConfig, file: string): boolean {
config.entryServerFile,
...Object.values(config.routes).map((route) => route.file),
];
return entryPoints.includes(appFile);
let normalized = normalizeSlashes(appFile);
return entryPoints.includes(normalized);
}

export type WatchOptions = {
Expand Down

0 comments on commit acdd7c7

Please sign in to comment.