From fa3f5603d839be497926f1b62edba442464c4366 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Sun, 10 Mar 2024 12:19:58 -0400 Subject: [PATCH] Build: fix size comparison for slim files when the branch is dirty Ref gh-5441 --- build/tasks/compare_size.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" );