diff --git a/src/index.ts b/src/index.ts index 739bb12..41729fb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -108,8 +108,11 @@ async function rebuild() { } for (const root of SOURCE_ROOTS) { - fs.watch(root, { recursive: true }, () => { - console.log(`Detected change in ${root}, rebuilding sourcemap...`) + fs.watch(root, { recursive: true }, (_, file) => { + if (file?.startsWith('.git/')) return + console.log( + `Detected change in ${root} -> ${file}; rebuilding sourcemap...`, + ) sourcemapCache.delete(root) rebuild() })