From 28ff566296bb53efa09ee5a3859cbbcbf8030fc9 Mon Sep 17 00:00:00 2001 From: Nick Balestra Date: Sat, 9 Sep 2017 13:39:01 +0100 Subject: [PATCH] proper ignore files/dirs --- src/cli/domain/watch.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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); } } );