-
-
Save twhid/2587326 to your computer and use it in GitHub Desktop.
grunt cssmin sqwish task
This file contains hidden or 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
// 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