diff options
author | Tom Fuertes <tomfuertes@gmail.com> | 2013-03-24 23:47:46 -0500 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2013-03-26 20:50:30 -0400 |
commit | 1f530e286755416369f4452d20f5ab6bb175451d (patch) | |
tree | 3e220353e0b6289a19218ba90b9d049068e7711f | |
parent | 100d3c351604e1f9641098da2e78678b4e6d9cdf (diff) | |
download | jquery-1f530e286755416369f4452d20f5ab6bb175451d.tar.gz jquery-1f530e286755416369f4452d20f5ab6bb175451d.zip |
No ticker: grunt_compare_size options. Close gh-1210.
-rw-r--r-- | Gruntfile.js | 11 | ||||
-rw-r--r-- | package.json | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index afa090c3d..fb8b1e8b0 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 7a4e544cd..b56b5c7bc 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": [] |