From: Tom Fuertes Date: Mon, 25 Mar 2013 04:47:46 +0000 (-0500) Subject: No ticker: grunt_compare_size options. Close gh-1210. X-Git-Tag: 1.10.0-beta1~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1402%2Fhead;p=jquery.git No ticker: grunt_compare_size options. Close gh-1210. (cherry picked from commit 1f530e286755416369f4452d20f5ab6bb175451d) --- diff --git a/Gruntfile.js b/Gruntfile.js index 7180a8a27..c6b739d17 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,6 +7,7 @@ module.exports = function( grunt ) { "dist/jquery.min.map", "dist/jquery.min.js" ], + gzip = require("gzip-js"), readOptionalJSON = function( filepath ) { var data = {}; try { @@ -19,7 +20,15 @@ module.exports = function( grunt ) { pkg: grunt.file.readJSON("package.json"), dst: readOptionalJSON("dist/.destination.json"), compare_size: { - files: distpaths + files: [ "dist/jquery.js", "dist/jquery.min.js" ], + options: { + compress: { + gz: function( contents ) { + return gzip.zip( contents, {} ).length; + } + }, + cache: "dist/.sizecache.json" + } }, selector: { destFile: "src/selector-sizzle.js", diff --git a/package.json b/package.json index 5eea0d8c8..6607ed9b6 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "grunt-contrib-jshint": "0.1.1rc6", "grunt-contrib-uglify": "0.1.2", "grunt": "0.4.1", + "gzip-js": "0.3.1", "testswarm": "0.2.2" }, "keywords": []