Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Report compressed sizes in compare_size #2248

Merged
merged 3 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
timmywil marked this conversation as resolved.
Show resolved Hide resolved
}
},
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