Conversation
| if (!enoent) { | ||
| if (options.ignoreDotFiles && path.basename(f)[0] === '.') return done && callback(null, callback.files); | ||
| if (options.filter && !options.filter(f, stat)) return done && callback(null, callback.files); | ||
| if (options.ignoreDirectoryPattern && options.ignoreDirectoryPattern.test(f)) return done && callback(null, callback.files); |
There was a problem hiding this comment.
I think stat.isDirectory() is necessary, otherwise not only the directories but also the files match to ignoreDirectoryPattern is also ignored.
There was a problem hiding this comment.
FYI: I also tried to fix this issue. Here is my patch.
|
As this repository hasn't been maintained for a long time, here is the note for someone wants to use the fixed version of this issue. "dependency":
"watch": "Leonid-Yeromin/watch" (or "kena0ki/watch") |
|
@kena0ki I've installed your version and ran both of the following scripts: Neither could get my Do you have an example on how to use this or am I doing it wrong? |
|
Maybe it's not 'dependency' but 'dependencies'. "dependencies": {
"watch": "Leonid-Yeromin/watch" (or "kena0ki/watch")
} |
|
I understood what you meant, it's fine, I no longer need a solution. I went with chokidar... I created a script called "watch" whose sole purpose is to run this file: const build = () => {
exec('npm run build')
}
chokidar.watch('.', {
ignored: [
'dist',
'node_modules',
'build.js',
'package.json',
'pnpm-lock.yaml',
'tsconfig.json',
],
ignoreInitial: true,
persistent: true,
}).on('all', () => {
build();
});I would've love to have it in my scripts, but I'm not too hurt about it, I'm starting to like having a few scripts handy. |
Fix problem with watching directory ignored in ignoreDirectoryPattern
jasmine tests added:
npm test