From e3a802cbf7d66d88e3659ad344bce86b99d029be Mon Sep 17 00:00:00 2001 From: Tom Fuertes Date: Sun, 24 Mar 2013 23:47:46 -0500 Subject: [PATCH] No ticker: grunt_compare_size options. Close gh-1210. (cherry picked from commit 1f530e286755416369f4452d20f5ab6bb175451d) --- Gruntfile.js | 11 ++++++++++- package.json | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) 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": [] -- 2.39.5