Closed codeviking closed 9 years ago
Thanks @codeviking! I wrote this up already in https://github.com/substack/watchify/pull/212 but forgot about it (prob because it meant bumping the major version). A few things:
anymatch
to minimatch
so globing is inline with browserify (bugs and all). But I'll take anymatch
for now since that means I don't need to bump the major version.If you want to make these changes, then I can look at your PR again - otherwise, I can move https://github.com/substack/watchify/pull/212 to anymatch and merge that tmw.
I'm actually traveling for a week but I'm happy to make the changes once I return. No rush in merging as we're just using my fork in the interim.
Thanks!
@zertosh Checking back in. I'll make these changes this morning and submit you an updated PR.
If you call
chokidar.watch(path, { ignored: '/some/string/that/matches/path' });
it'll still add a watcher to the file.This adds a filter in
watchFile
which prevents the watcher from getting added if it matches theignored
glob.This avoided watching files in
node_modules
for a particular project I'm working on and also corrected a segfault which would occur as a result (because of the watch handlers attached to files which were removed via annpm update
call).