mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Update the map reference in each minified file.
(cherry picked from commit ebc7899ba1
)
This commit is contained in:
parent
2f2e045ea6
commit
df372ad6e7
@ -149,10 +149,10 @@ function makeReleaseCopies( next ) {
|
|||||||
Object.keys( releaseFiles ).forEach(function( key ) {
|
Object.keys( releaseFiles ).forEach(function( key ) {
|
||||||
var text,
|
var text,
|
||||||
builtFile = releaseFiles[ key ],
|
builtFile = releaseFiles[ key ],
|
||||||
releaseFile = key.replace( /VER/g, releaseVersion );
|
releaseFile = "dist/" + key.replace( /VER/g, releaseVersion );
|
||||||
|
|
||||||
// Beta releases don't update the jquery-latest etc. copies
|
// Beta releases don't update the jquery-latest etc. copies
|
||||||
if ( !isBeta || key !== releaseFile ) {
|
if ( !isBeta || key.indexOf( "VER" ) >= 0 ) {
|
||||||
|
|
||||||
if ( /\.map$/.test( releaseFile ) ) {
|
if ( /\.map$/.test( releaseFile ) ) {
|
||||||
// Map files need to reference the new uncompressed name;
|
// Map files need to reference the new uncompressed name;
|
||||||
@ -162,10 +162,17 @@ function makeReleaseCopies( next ) {
|
|||||||
.replace( /"file":"([^"]+)","sources":\["([^"]+)"\]/,
|
.replace( /"file":"([^"]+)","sources":\["([^"]+)"\]/,
|
||||||
"\"file\":\"" + releaseFile.replace( /\.min\.map/, ".min.js" ) +
|
"\"file\":\"" + releaseFile.replace( /\.min\.map/, ".min.js" ) +
|
||||||
"\",\"sources\":[\"" + releaseFile.replace( /\.min\.map/, ".js" ) + "\"]" );
|
"\",\"sources\":[\"" + releaseFile.replace( /\.min\.map/, ".js" ) + "\"]" );
|
||||||
console.log( "Modifying map " + builtFile + " to " + releaseFile );
|
fs.writeFileSync( releaseFile, text );
|
||||||
fs.writeFileSync( "dist/" + releaseFile, text );
|
} else if ( /\.min\.js$/.test( releaseFile ) ) {
|
||||||
} else {
|
// Minified files point back to the corresponding map;
|
||||||
copy( builtFile, "dist/" + releaseFile );
|
// again assume one big happy directory.
|
||||||
|
// "//@ sourceMappingURL=jquery.min.map"
|
||||||
|
text = fs.readFileSync( builtFile, "utf8" )
|
||||||
|
.replace( /\/\/@ sourceMappingURL=\S+/,
|
||||||
|
"//@ sourceMappingURL=" + releaseFile.replace( /\.js$/, ".map" ) );
|
||||||
|
fs.writeFileSync( releaseFile, text );
|
||||||
|
} else if ( builtFile !== releaseFile ) {
|
||||||
|
copy( builtFile, releaseFile );
|
||||||
}
|
}
|
||||||
|
|
||||||
jQueryFilesCDN.push( releaseFile );
|
jQueryFilesCDN.push( releaseFile );
|
||||||
|
Loading…
Reference in New Issue
Block a user