From 0089858eb82b4139ef0b39a6b6c5431f5577d0dd Mon Sep 17 00:00:00 2001 From: Mingyu Gu Date: Fri, 29 Jun 2018 15:49:13 +0800 Subject: [PATCH] Fixed 'exclude' config does not work issue Matching paths require add the `{ matchBase: true }` paramter --- lib/filter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/filter.js b/lib/filter.js index 8aa00c4..e7795d3 100644 --- a/lib/filter.js +++ b/lib/filter.js @@ -20,7 +20,7 @@ function logic_html(str, data) { if (path && exclude && exclude.length) { for (var i = 0, len = exclude.length; i < len; i++) { - if (minimatch(path, exclude[i])) return str; + if (minimatch(path, exclude[i], {matchBase: true})) return str; } } @@ -46,7 +46,7 @@ function logic_css(str, data) { if (path && exclude && exclude.length) { for (var i = 0, len = exclude.length; i < len; i++) { - if (minimatch(path, exclude[i])) return str; + if (minimatch(path, exclude[i], {matchBase: true})) return str; } } @@ -76,7 +76,7 @@ function logic_js(str, data) { if (path && exclude && exclude.length) { for (var i = 0, len = exclude.length; i < len; i++) { - if (minimatch(path, exclude[i])) return str; + if (minimatch(path, exclude[i], {matchBase: true})) return str; } }