]> source.dussan.org Git - jquery.git/commitdiff
Do not include the path in map references.
authorDave Methvin <dave.methvin@gmail.com>
Fri, 24 May 2013 16:37:32 +0000 (12:37 -0400)
committerDave Methvin <dave.methvin@gmail.com>
Fri, 24 May 2013 16:38:00 +0000 (12:38 -0400)
(cherry picked from commit 9cbd6898b9deb1a21b796933ba6f4e6dd801172e)

build/release.js

index d3a129cfcc0ee5c6f80073aaab3d437602bc37b8..d4161cdbc2956608217c8ccc292b6526ceb77032 100644 (file)
@@ -148,7 +148,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 ) {
@@ -159,8 +160,8 @@ 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;
@@ -168,7 +169,7 @@ function makeReleaseCopies( next ) {
                                // "//@ 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 );