Fixed 'exclude' config does not work issue

Matching paths require add the `{ matchBase: true }` paramter
This commit is contained in:
Mingyu Gu 2018-06-29 15:49:13 +08:00 committed by GitHub
parent 892cde9a78
commit 0089858eb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ function logic_html(str, data) {
if (path && exclude && exclude.length) { if (path && exclude && exclude.length) {
for (var i = 0, len = exclude.length; i < len; i++) { 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) { if (path && exclude && exclude.length) {
for (var i = 0, len = exclude.length; i < len; i++) { 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) { if (path && exclude && exclude.length) {
for (var i = 0, len = exclude.length; i < len; i++) { 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;
} }
} }