Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replace min_max_info helper, use gzip-js directly

  • Loading branch information...
commit d866a28c8391ec1fa2b86112a04ae3a3c383fe0e 1 parent 51729e5
@jzaefferer authored
Showing with 10 additions and 3 deletions.
  1. +3 −2 package.json
  2. +7 −1 tasks/grunt-css.js
View
5 package.json
@@ -28,9 +28,10 @@
"test": "grunt test"
},
"dependencies": {
- "grunt": "~0.3.4",
+ "grunt": "0.3.x",
"sqwish": "0.2.x",
- "csslint": "0.9.x"
+ "csslint": "0.9.x",
+ "gzip-js": "0.3.1"
},
"devDependencies": {
},
View
8 tasks/grunt-css.js
@@ -7,6 +7,12 @@
*/
module.exports = function(grunt) {
+ function min_max(min, max) {
+ var gzip = require('gzip-js');
+ var gzipSize = String(gzip.zip(min, {}).length);
+ grunt.log.writeln('Uncompressed size: ' + String(max.length).green + ' bytes.');
+ grunt.log.writeln('Compressed size: ' + gzipSize.green + ' bytes gzipped (' + String(min.length).green + ' bytes minified).');
+ }
grunt.registerMultiTask( "csslint", "Lint CSS files with csslint", function() {
var csslint = require( "csslint" ).CSSLint;
@@ -73,7 +79,7 @@ module.exports = function(grunt) {
var min = banner + require( "sqwish" ).minify( max, false );
grunt.file.write( this.file.dest, min );
grunt.log.writeln( "File '" + this.file.dest + "' created." );
- grunt.helper( "min_max_info", min, max );
+ min_max( min, max );
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.