From e8b9a68eec2bf1001567a584dc60d5ff3bef1fbc Mon Sep 17 00:00:00 2001 From: Jinbao1001 Date: Wed, 13 Nov 2024 16:43:06 +0800 Subject: [PATCH] fix: pnpm workspace watch too many files (#1684) --- crates/mako/src/dev/watch.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/mako/src/dev/watch.rs b/crates/mako/src/dev/watch.rs index 3c8dcc7ab..f28665203 100644 --- a/crates/mako/src/dev/watch.rs +++ b/crates/mako/src/dev/watch.rs @@ -150,10 +150,11 @@ impl<'a> Watcher<'a> { } fn watch_file_or_dir(&mut self, path: PathBuf, ignore_list: &[PathBuf]) -> anyhow::Result<()> { - if Self::should_ignore_watch(&path, ignore_list) { + if Self::should_ignore_watch(&path, ignore_list) + || path.to_string_lossy().contains("node_modules") + { return Ok(()); } - if path.is_file() && !self.watched_files.contains(&path) { self.watcher .watch(path.as_path(), notify::RecursiveMode::NonRecursive)?;