diff --git a/index.js b/index.js index 85a7b9b..72a41b8 100644 --- a/index.js +++ b/index.js @@ -129,8 +129,7 @@ const Compiler = { // 过滤不编译的文件 if (options.exclude) { - let exp = new RegExp(options.exclude, 'i') - if (exp.test(origin)) { + if (options.exclude.test(origin)) { return } } @@ -178,6 +177,10 @@ function __init__() { } } + if (options.exclude) { + options.exclude = new RegExp(options.exclude, 'i') + } + prefixer = postcss().use( autoprefixer({ browsers: options.browsers diff --git a/package.json b/package.json index 85f3aa0..4f4ce6a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "scss-to-css", "displayName": "scss-to-css", "description": "🔥 The easiest way to compile scss file to css. And autoprefixer at the same time.", - "version": "3.0.0", + "version": "3.0.1", "publisher": "yutent", "author": "Yutent [@yutent]", "icon": "logo.png",