From 15a35d0e34eae7d9f9ab641352d734b618642971 Mon Sep 17 00:00:00 2001 From: Devon Campbell Date: Wed, 19 Aug 2015 13:52:56 -0400 Subject: [PATCH] Allows for file exclusions This uses Grunt's glob pattern expansion to allow for file exclusions in `styles` and `src`. --- tasks/purifycss.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tasks/purifycss.js b/tasks/purifycss.js index aabaef1..5514a41 100644 --- a/tasks/purifycss.js +++ b/tasks/purifycss.js @@ -18,19 +18,11 @@ module.exports = function(grunt) { var options = this.options({ }); - var src = []; - this.data.src.forEach(function(pathPattern) { - var files = glob.sync(pathPattern); - console.log("Source Files: ", files); - src = src.concat(files); - }); + var src = grunt.file.expand(this.data.src); + grunt.verbose.writeln('Source files:', src); - var styles = []; - this.data.css.forEach(function(pathPattern) { - var style = glob.sync(pathPattern); - console.log("Style Files: ", style); - styles = styles.concat(style); - }); + var styles = grunt.file.expand(this.data.css); + grunt.verbose.writeln('Style files:', styles); var pure = purify(src, styles, {write: false, info: true});