]> source.dussan.org Git - jquery.git/commitdiff
No ticker: grunt_compare_size options. Close gh-1210. 1383/head 1402/head 1432/head 1581/head
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:54:07 +0000 (20:54 -0400)
(cherry picked from commit 1f530e286755416369f4452d20f5ab6bb175451d)

Gruntfile.js
package.json

index 7180a8a27861c0adcf9656e86b1d0473b1b530f4..c6b739d176c42102c7a8b1dc4536f0c574f20d80 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 5eea0d8c8ff3edbe0fc81b86e70e047098ed6ecf..6607ed9b60ef5e5269b90743383cab5d19005f53 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": []