diff --git a/.changeset/light-bikes-exercise.md b/.changeset/light-bikes-exercise.md new file mode 100644 index 00000000000..bccbcb7e294 --- /dev/null +++ b/.changeset/light-bikes-exercise.md @@ -0,0 +1,6 @@ +--- +"remix": patch +"@remix-run/dev": patch +--- + +normalize file paths before testing if a changed file is a route entry diff --git a/packages/remix-dev/compiler/watch.ts b/packages/remix-dev/compiler/watch.ts index 2b0461850ce..7c1901121ae 100644 --- a/packages/remix-dev/compiler/watch.ts +++ b/packages/remix-dev/compiler/watch.ts @@ -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); @@ -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 = {