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