Skip to content

Commit

Permalink
Build: Report compressed sizes in compare_size
Browse files Browse the repository at this point in the history
Just like it has always worked in Core. This will help with size comparisons
between 1.13 & 1.14.
  • Loading branch information
mgol committed May 10, 2024
1 parent 795b773 commit 9a62c55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module.exports = function( grunt ) {

const gzip = require( "gzip-js" );

// files
const coreFiles = [
"core.js",
Expand Down Expand Up @@ -75,7 +77,15 @@ const compareFiles = {
all: [
"dist/jquery-ui.js",
"dist/jquery-ui.min.js"
]
],
options: {
compress: {
gz: function( contents ) {
return gzip.zip( contents, {} ).length;
}
},
cache: "build/.sizecache.json"
}
};

const htmllintBad = [
Expand Down Expand Up @@ -115,8 +125,6 @@ uiFiles.concat( allI18nFiles ).forEach( function( file ) {
} );

uiFiles.forEach( function( file ) {

// TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13
compareFiles[ file ] = [ file, mapMinFile( file ) ];
} );

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"grunt-eslint": "24.0.1",
"grunt-git-authors": "3.2.0",
"grunt-html": "16.0.0",
"gzip-js": "0.3.2",
"load-grunt-tasks": "5.1.0",
"rimraf": "4.4.1",
"selenium-webdriver": "4.18.1",
Expand Down

0 comments on commit 9a62c55

Please sign in to comment.