From f19848c11ea051fd0febe8f2ff38d7acc9ff057e Mon Sep 17 00:00:00 2001 From: Konnor Rogers Date: Fri, 18 Jul 2025 00:43:29 -0400 Subject: [PATCH] prevent infinite loop in build watcher (#1200) * prevent infinite loop in build watcher * prettier --- packages/webawesome/scripts/build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webawesome/scripts/build.js b/packages/webawesome/scripts/build.js index 790ab3007..38cf11e7d 100644 --- a/packages/webawesome/scripts/build.js +++ b/packages/webawesome/scripts/build.js @@ -389,7 +389,7 @@ export async function build(options = {}) { const watchEvents = ['change', 'unlink', 'add']; // Rebuild and reload when source files change options.watchedSrcDirectories.forEach(dir => { - const watcher = bs.watch(join(dir, '**', '!(*.test).*')); + const watcher = bs.watch(join(dir, '**', '!(*.test).*'), { ignoreInitial: true }); watchEvents.forEach(evt => { watcher.on(evt, handleWatchEvent(evt)); @@ -456,7 +456,7 @@ export async function build(options = {}) { // Rebuild the docs and reload when the docs change options.watchedDocsDirectories.forEach(dir => { - const watcher = bs.watch(join(dir, '**', '*.*')); + const watcher = bs.watch(join(dir, '**', '*.*'), { ignoreInitial: true }); watchEvents.forEach(evt => { watcher.on(evt, handleWatchEvent(evt));