diff --git a/lib/monitor/match.js b/lib/monitor/match.js index 0d5b5467..1c7c4cf2 100644 --- a/lib/monitor/match.js +++ b/lib/monitor/match.js @@ -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); } diff --git a/lib/monitor/watch.js b/lib/monitor/watch.js index 13b63b7a..a9618256 100644 --- a/lib/monitor/watch.js +++ b/lib/monitor/watch.js @@ -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.