Skip to content

Commit b3fc3a9

Browse files
committed
fix: in watch, use fully filtered ignore rules
Fixes #1348
1 parent ff79835 commit b3fc3a9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/monitor/match.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ function match(files, monitor, ext) {
154154
var prefix = s.slice(0, 1);
155155

156156
if (prefix === '!') {
157+
if (s.indexOf('!' + cwd) === 0) {
158+
return s;
159+
}
157160
return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1);
158161
}
159162

lib/monitor/watch.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ function watch() {
4141

4242
const promise = new Promise(function (resolve) {
4343
const dotFilePattern = /[/\\]\./;
44-
var ignored = Array.from(rootIgnored);
44+
var ignored = match.rulesToMonitor(
45+
[], // not needed
46+
Array.from(rootIgnored),
47+
config
48+
).map(pattern => pattern.slice(1));
49+
4550
const addDotFile = dirs.filter(dir => dir.match(dotFilePattern));
4651

4752
// don't ignore dotfiles if explicitly watched.

0 commit comments

Comments
 (0)