From 9bbe15c406ca70c1642a5459a43a1e0d82d045e7 Mon Sep 17 00:00:00 2001 From: aurelien Date: Sat, 12 Oct 2024 11:08:53 +0200 Subject: [PATCH] fix #2798: deleting a file trigger a build --- src/Eleventy.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Eleventy.js b/src/Eleventy.js index f918ab746..b5084f4b4 100644 --- a/src/Eleventy.js +++ b/src/Eleventy.js @@ -1217,9 +1217,14 @@ Arguments: await watchRun(path); }); - watcher.on("unlink", (path) => { - // this.logger.forceLog(`File removed: ${path}`); + watcher.on("unlink", async (path) => { + // Emulated passthrough copy logs from the server + if (!this.eleventyServe.isEmulatedPassthroughCopyMatch(path)) { + this.logger.forceLog(`File removed: ${path}`); + } + this.fileSystemSearch.delete(path); + await watchRun(path); }); }