From afe2eb4af80358a6a55223b48aa296acd1d2e329 Mon Sep 17 00:00:00 2001 From: hyper Date: Wed, 8 Apr 2026 19:43:32 +0800 Subject: [PATCH] fix: cli file change detection now includes csv/yarn --- src/cli/commands/serve.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/commands/serve.ts b/src/cli/commands/serve.ts index 46a3001..d3d7b20 100644 --- a/src/cli/commands/serve.ts +++ b/src/cli/commands/serve.ts @@ -223,7 +223,7 @@ export function createContentServer( watcher .on("add", (path) => { - if (path.endsWith(".md")) { + if (path.endsWith(".md") || path.endsWith(".csv") || path.endsWith(".yarn")) { try { const content = readFileSync(path, "utf-8"); const relPath = "/" + relative(contentDir, path).split(sep).join("/"); @@ -235,7 +235,7 @@ export function createContentServer( } }) .on("change", (path) => { - if (path.endsWith(".md")) { + if (path.endsWith(".md") || path.endsWith(".csv") || path.endsWith(".yarn")) { try { const content = readFileSync(path, "utf-8"); const relPath = "/" + relative(contentDir, path).split(sep).join("/"); @@ -247,7 +247,7 @@ export function createContentServer( } }) .on("unlink", (path) => { - if (path.endsWith(".md")) { + if (path.endsWith(".md") || path.endsWith(".csv") || path.endsWith(".yarn")) { const relPath = "/" + relative(contentDir, path).split(sep).join("/"); delete contentIndex[relPath]; console.log(`[删除] ${relPath}`);