diff --git a/src/cli/domain/watch.js b/src/cli/domain/watch.js index a9b5f0cbd..4cd567b0b 100644 --- a/src/cli/domain/watch.js +++ b/src/cli/domain/watch.js @@ -10,18 +10,17 @@ module.exports = function(dirs, baseDir, changed) { { interval: 0.5, ignoreUnreadableDir: true, - ignoreDotFiles: false + ignoreDotFiles: false, + filter: fileOrDir => + /node_modules|package\.tar\.gz|_package|\.sw[op]|\.git|\.DS_Store|oc\.json/.test( + fileOrDir + ) === false }, (fileName, currentStat, previousStat) => { + console.log(fileName); if (!!currentStat || !!previousStat) { - if ( - /node_modules|package\.tar\.gz|_package|\.sw[op]|\.git|\.DS_Store/gi.test( - fileName - ) === false - ) { - const componentDir = dirs.find(dir => Boolean(fileName.match(dir))); - changed(null, fileName, componentDir); - } + const componentDir = dirs.find(dir => Boolean(fileName.match(dir))); + changed(null, fileName, componentDir); } } );