Skip to content

Commit

Permalink
fix: pnpm workspace watch too many files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed Nov 8, 2024
1 parent eacee04 commit 6d9a8ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/mako/src/dev/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check warning on line 154 in crates/mako/src/dev/watch.rs

View check run for this annotation

Codecov / codecov/patch

crates/mako/src/dev/watch.rs#L153-L154

Added lines #L153 - L154 were not covered by tests
{
return Ok(());
}

if path.is_file() && !self.watched_files.contains(&path) {
self.watcher
.watch(path.as_path(), notify::RecursiveMode::NonRecursive)?;
Expand Down

0 comments on commit 6d9a8ed

Please sign in to comment.