From: Timmy Willison Date: Sun, 10 Mar 2024 16:19:58 +0000 (-0400) Subject: Build: fix size comparison for slim files when the branch is dirty X-Git-Tag: 4.0.0-beta.2~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8a3a74c475f92148675af4ee3f77e3d1746e6e88;p=jquery.git Build: fix size comparison for slim files when the branch is dirty Ref gh-5440 --- diff --git a/build/tasks/compare_size.mjs b/build/tasks/compare_size.mjs index ea239fb27..554b1087a 100644 --- a/build/tasks/compare_size.mjs +++ b/build/tasks/compare_size.mjs @@ -109,7 +109,7 @@ export async function compareSize( { cache = ".sizecache.json", files } = {} ) { // Remove the short SHA and .dirty from comparisons. // The short SHA so commits can be compared against each other // and .dirty to compare with the existing branch during development. - const sha = /jQuery v\d+.\d+.\d+(?:-\w+)?(?:\+|\+slim\.)?([^ \.]+(?:\.dirty)?)?/.exec( contents )[ 1 ]; + const sha = /jQuery v\d+.\d+.\d+(?:-\w+)?(?:\+slim\.|\+)?([^ \.]+(?:\.dirty)?)?/.exec( contents )[ 1 ]; contents = contents.replace( new RegExp( sha, "g" ), "" ); const size = Buffer.byteLength( contents, "utf8" );