Skip to content

Instantly share code, notes, and snippets.

@twhid
Forked from FiNGAHOLiC/cssmin.js
Created May 3, 2012 17:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twhid/2587326 to your computer and use it in GitHub Desktop.
Save twhid/2587326 to your computer and use it in GitHub Desktop.
grunt cssmin sqwish task
// grunt minify CSS task using sqwish
grunt.registerMultiTask('cssmin', 'minify css with sqwish', function () {
var sqwish = require('sqwish'),
dest = this.file.dest;
try {
var css = grunt.file.read(this.file.src),
min = sqwish.minify(css);
grunt.file.write(dest, min);
grunt.log.writeln('File ' + dest + ' created.');
grunt.helper('min_max_info', min, css);
} catch ( e ) {
grunt.log.writeln(e.message);
return false;
}
return true;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment