Skip to content
Browse files

Updates Jakefile to use new zlib api

  • Loading branch information...
1 parent 796e8e1 commit 21575efd57f76c927c8b7407491a3a8a20f737c4 @rwaldron rwaldron committed
Showing with 13 additions and 4 deletions.
  1. +13 −4 Jakefile.js
View
17 Jakefile.js
@@ -48,8 +48,10 @@ var // Program References
evil: true,
forin: false,
maxerr: 100,
- eqnull: true
- // "curly": true,
+ eqnull: true,
+ curly: true,
+ browser: true
+ // onevar: true,
// "eqnull": true,
// "immed": true,
// "newcap": true,
@@ -198,7 +200,14 @@ function uglify( src ) {
// Return deflated src input.
function gzip( src ) {
- return zlib.deflate( new Buffer( src ) );
+
+ if ( zlib.Deflate ) {
+ return zlib.gzip( src, function( err, buffer ) {
+ ok( "Compressed size: " + (buffer.length + "").yellow + " bytes gzipped (" + ( src.length + "" ).yellow + " bytes minified)." );
+ });
+ }
+
+ ok( "Compressed size: " + (zlib.deflate( src ).length + "").yellow + " bytes gzipped (" + ( src.length + "" ).yellow + " bytes minified)." );
}
// Jake Tasks
@@ -281,7 +290,7 @@ task( "min", function() {
min = intro + min;
if ( writeFile( minpath, min, false ) ) {
- ok( "Compressed size: " + (gzip( min ).length + "").yellow + " bytes gzipped (" + ( min.length + "" ).yellow + " bytes minified)." );
+ gzip( min );
}
}
});

0 comments on commit 21575ef

Please sign in to comment.
Something went wrong with that request. Please try again.