From 93f76d7978f0375804818d9e1b47d516571ce8e3 Mon Sep 17 00:00:00 2001 From: Giuseppe Alfieri <150775639+giusalfieri@users.noreply.github.com> Date: Sun, 7 Sep 2025 14:58:26 +0200 Subject: [PATCH] Fix: normalize chokidar paths for hot reload on Windows Hot reload was not updating pages when editing Markdown files inside subfolders on Windows only. The issue was caused by inconsistent path separators from chokidar. This patch ensures paths are normalized with toPosixPath before rebuild. --- quartz/build.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quartz/build.ts b/quartz/build.ts index d9f5efcd7..f3adfe250 100644 --- a/quartz/build.ts +++ b/quartz/build.ts @@ -151,16 +151,19 @@ async function startWatching( const changes: ChangeEvent[] = [] watcher .on("add", (fp) => { + fp = toPosixPath(fp) if (buildData.ignored(fp)) return changes.push({ path: fp as FilePath, type: "add" }) void rebuild(changes, clientRefresh, buildData) }) .on("change", (fp) => { + fp = toPosixPath(fp) if (buildData.ignored(fp)) return changes.push({ path: fp as FilePath, type: "change" }) void rebuild(changes, clientRefresh, buildData) }) .on("unlink", (fp) => { + fp = toPosixPath(fp) if (buildData.ignored(fp)) return changes.push({ path: fp as FilePath, type: "delete" }) void rebuild(changes, clientRefresh, buildData)