]> source.dussan.org Git - jquery.git/commitdiff
Build: fix size comparison for slim files when the branch is dirty
authorTimmy Willison <timmywil@users.noreply.github.com>
Sun, 10 Mar 2024 16:19:58 +0000 (12:19 -0400)
committerTimmy Willison <timmywil@users.noreply.github.com>
Mon, 11 Mar 2024 17:36:09 +0000 (13:36 -0400)
Ref gh-5441

build/tasks/compare_size.mjs

index ea239fb27fb2261764abcb0ee2de5bb1f59189ed..554b1087a9fdc40a2cbacb11f871291f4d767264 100644 (file)
@@ -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" );