diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2016-09-18 22:07:34 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2016-09-19 13:03:32 -0400 |
commit | 37f1da6b91a86ef3f54f4cf16dd87f5afd33c835 (patch) | |
tree | 018f85e2c752356af55fc6afe176f13490bb53e5 /build | |
parent | 223ed99f4a7e6259daf90af9bce849d1400b11d6 (diff) | |
download | jquery-37f1da6b91a86ef3f54f4cf16dd87f5afd33c835.tar.gz jquery-37f1da6b91a86ef3f54f4cf16dd87f5afd33c835.zip |
Build: Make sourcemap updates in two .replace() passes
Fixes gh-3260
Closes gh-3321
Diffstat (limited to 'build')
-rw-r--r-- | build/release/cdn.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/build/release/cdn.js b/build/release/cdn.js index 3b485112e..050606203 100644 --- a/build/release/cdn.js +++ b/build/release/cdn.js @@ -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 ); |