From 959cfebc5a7729e0338ef4237f537b20391fb3d7 Mon Sep 17 00:00:00 2001 From: cxy930123 <mail@xingyu1993.cn> Date: Wed, 22 Jul 2020 10:49:05 +0800 Subject: [PATCH] fix #61 exclude option --- index.js | 2 +- lib/type.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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) => {