]> source.dussan.org Git - jquery.git/commitdiff
No ticker: grunt_compare_size options. Close gh-1210.
authorTom Fuertes <tomfuertes@gmail.com>
Mon, 25 Mar 2013 04:47:46 +0000 (23:47 -0500)
committerRichard Gibson <richard.gibson@gmail.com>
Wed, 27 Mar 2013 00:50:30 +0000 (20:50 -0400)
Gruntfile.js
package.json

index afa090c3dca1cca0f605c04f70f538aec51a8d56..fb8b1e8b043c3695906749e6a652f2acbbbd14c1 100644 (file)
@@ -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",
index 7a4e544cdc20e77d31fb3adadbc6f1c8a828590b..b56b5c7bc9d46ea2712ce36b2a6588b0bbbeb721 100644 (file)
@@ -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": []