Created
April 14, 2012 16:50
-
-
Save Takazudo/2385845 to your computer and use it in GitHub Desktop.
grunt cssmin sqwish task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* cssmin tasks | |
* sqwish: https://github.com/ded/sqwish | |
*/ | |
module.exports = function(grunt){ | |
var log = grunt.log; | |
var sqwish = require('sqwish'); | |
grunt.registerMultiTask('cssmin', 'minify css by sqwish', function() { | |
var dest = this.data.dest; | |
try { | |
var css = grunt.file.read(this.data.src); | |
var minified = sqwish.minify(css); | |
grunt.file.write(dest, minified); | |
} catch(e) { | |
log.writeln(e.message); | |
grunt.helper('growl', 'SQWISH GOT ERROR', e.message); | |
return false; | |
} | |
return true; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment