diff --git a/index.js b/index.js index d4e12fa..f98b29f 100644 --- a/index.js +++ b/index.js @@ -35,7 +35,7 @@ module.exports = postcss.plugin("postcss-pxtorem", options => { exclude && ((type.isFunction(exclude) && exclude(filePath)) || (type.isString(exclude) && filePath.indexOf(exclude) !== -1) || - filePath.match(exclude) !== null) + (type.isRegExp(exclude) && filePath.match(exclude) !== null)) ) { return; } diff --git a/lib/type.js b/lib/type.js index dda695f..429864a 100644 --- a/lib/type.js +++ b/lib/type.js @@ -12,7 +12,8 @@ const types = [ "Number", "Function", "Symbol", - "Object" + "Object", + "RegExp" ]; module.exports = types.reduce((acc, str) => {