Skip to content

Commit e5e1ee3

Browse files
authored
Release: Fix the map file
The map file had incorrect file references. This is now fixed. Closes gh-614 Ref gh-613
1 parent fb55672 commit e5e1ee3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build/release.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ function writeJsonSync( fname, json ) {
314314
}
315315

316316
function fixMinRef( oldText ) {
317-
var mapRef = new RegExp( "^//# sourceMappingURL=jquery-migrate.min.map\\n?", "m" );
317+
var mapRef = new RegExp( "^//# sourceMappingURL=jquery-migrate\\..*\\.map\\n?", "m" );
318318

319319
// Remove the ref for now rather than try to fix it
320320
var newText = oldText.replace( mapRef, "" );
@@ -333,7 +333,14 @@ function fixMapRef( oldText, newFile ) {
333333

334334
// This file isn't published, not sure the best way to deal with that
335335
sources[ 0 ] = "migratemute.js";
336-
sources[ 1 ] = newFile.replace( /\.map$/, ".js" );
336+
sources[ 1 ] = newFile.replace( /\.min\.map$/, ".js" );
337+
338+
// Path to the minified file for which this is the map.
339+
// The minified file is originally created from a versionless file,
340+
// so this field needs to be regenerated to contain the version
341+
// if `newFile` contains it.
342+
mapJSON.file = newFile.replace( /\.min\.map$/, ".min.js" );
343+
337344
return JSON.stringify( mapJSON );
338345
}
339346

0 commit comments

Comments
 (0)