fix: in watch, use fully filtered ignore rules

Fixes #1348
This commit is contained in:
Remy Sharp
2018-05-18 20:46:08 +01:00
parent ee2aac1651
commit 11d13f24eb
2 changed files with 9 additions and 1 deletions

View File

@@ -154,6 +154,9 @@ function match(files, monitor, ext) {
var prefix = s.slice(0, 1);
if (prefix === '!') {
if (s.indexOf('!' + cwd) === 0) {
return s;
}
return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1);
}

View File

@@ -41,7 +41,12 @@ function watch() {
const promise = new Promise(function (resolve) {
const dotFilePattern = /[/\\]\./;
var ignored = Array.from(rootIgnored);
var ignored = match.rulesToMonitor(
[], // not needed
Array.from(rootIgnored),
config
).map(pattern => pattern.slice(1));
const addDotFile = dirs.filter(dir => dir.match(dotFilePattern));
// don't ignore dotfiles if explicitly watched.