Skip to content
Permalink
Browse files
Do not include the path in map references.
  • Loading branch information
dmethvin committed May 24, 2013
1 parent 997da31 commit 9cbd6898b9deb1a21b796933ba6f4e6dd801172e
Showing with 5 additions and 4 deletions.
  1. +5 −4 build/release.js
@@ -149,7 +149,8 @@ function makeReleaseCopies( next ) {
Object.keys( releaseFiles ).forEach(function( key ) {
var text,
builtFile = releaseFiles[ key ],
releaseFile = "dist/" + key.replace( /VER/g, releaseVersion );
unpathedFile = key.replace( /VER/g, releaseVersion ),
releaseFile = "dist/" + unpathedFile;

// Beta releases don't update the jquery-latest etc. copies
if ( !isBeta || key.indexOf( "VER" ) >= 0 ) {
@@ -160,16 +161,16 @@ function makeReleaseCopies( next ) {
// "file":"jquery.min.js","sources":["jquery.js"]
text = fs.readFileSync( builtFile, "utf8" )
.replace( /"file":"([^"]+)","sources":\["([^"]+)"\]/,
"\"file\":\"" + releaseFile.replace( /\.min\.map/, ".min.js" ) +
"\",\"sources\":[\"" + releaseFile.replace( /\.min\.map/, ".js" ) + "\"]" );
"\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js" ) +
"\",\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
fs.writeFileSync( releaseFile, text );
} else if ( /\.min\.js$/.test( releaseFile ) ) {
// Minified files point back to the corresponding map;
// again assume one big happy directory.
// "//@ sourceMappingURL=jquery.min.map"
text = fs.readFileSync( builtFile, "utf8" )
.replace( /\/\/@ sourceMappingURL=\S+/,
"//@ sourceMappingURL=" + releaseFile.replace( /\.js$/, ".map" ) );
"//@ sourceMappingURL=" + unpathedFile.replace( /\.js$/, ".map" ) );
fs.writeFileSync( releaseFile, text );
} else if ( builtFile !== releaseFile ) {
copy( builtFile, releaseFile );

0 comments on commit 9cbd689

Please sign in to comment.