]> source.dussan.org Git - jquery.git/commitdiff
Build: Make sourcemap updates in two .replace() passes
authorDave Methvin <dave.methvin@gmail.com>
Mon, 19 Sep 2016 02:07:34 +0000 (22:07 -0400)
committerDave Methvin <dave.methvin@gmail.com>
Mon, 19 Sep 2016 17:03:32 +0000 (13:03 -0400)
Fixes gh-3260
Closes gh-3321

build/release/cdn.js

index 3b485112e9a6f36e6bbbc81ce858f3048cd3162e..0506062032ff067d843d967c8eb2438074ab9b3d 100644 (file)
@@ -40,11 +40,12 @@ function makeReleaseCopies( Release ) {
 
                        // Map files need to reference the new uncompressed name;
                        // assume that all files reside in the same directory.
-                       // "file":"jquery.min.js","sources":["jquery.js"]
+                       // "file":"jquery.min.js" ... "sources":["jquery.js"]
                        text = fs.readFileSync( builtFile, "utf8" )
-                               .replace( /"file":"([^"]+)","sources":\["([^"]+)"\]/,
-                                       "\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js" ) +
-                                       "\",\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
+                               .replace( /"file":"([^"]+)"/,
+                                       "\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js\"" ) )
+                               .replace( /"sources":\["([^"]+)"\]/,
+                                       "\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
                        fs.writeFileSync( releaseFile, text );
                } else if ( builtFile !== releaseFile ) {
                        shell.cp( "-f", builtFile, releaseFile );