aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2013-09-05 18:24:13 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2013-09-05 18:24:13 +0200
commit9035cab8c8574404c9eaeb795d0d87f4df772d45 (patch)
treea5d51de7dbd3dd62ab96491abf6fb68cb3d2b255
parente4cfe8242ce3c8084623a65db605896e2dba6968 (diff)
downloadjquery-9035cab8c8574404c9eaeb795d0d87f4df772d45.tar.gz
jquery-9035cab8c8574404c9eaeb795d0d87f4df772d45.zip
Fix #13983. Switch to //# for sourcemap directives. (cherry-picked from dfaee326e6605dc6d848c4c5022e39069d2cee65)
-rw-r--r--Gruntfile.js6
-rw-r--r--build/tasks/dist.js12
-rw-r--r--build/tasks/uglify.js6
3 files changed, 3 insertions, 21 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 8bd906b3f..e62255720 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -83,12 +83,10 @@ module.exports = function( grunt ) {
"dist/jquery.pre-min.js": [ "dist/jquery.js" ]
},
options: {
- banner: "\n\n\n\n\n\n\n\n\n\n" + // banner line size must be preserved
+ banner: "\n\n\n\n\n\n\n\n\n\n\n\n" + // banner line size must be preserved
"/*! jQuery v<%= pkg.version %> | " +
"(c) 2005, 2013 jQuery Foundation, Inc. | " +
- "jquery.org/license\n" +
- "//@ sourceMappingURL=jquery.min.map\n" +
- "*/\n"
+ "jquery.org/license */\n"
}
}
},
diff --git a/build/tasks/dist.js b/build/tasks/dist.js
index 591078cde..97d882e70 100644
--- a/build/tasks/dist.js
+++ b/build/tasks/dist.js
@@ -57,18 +57,6 @@ module.exports = function( grunt ) {
if ( /\.map$/.test( filename ) ) {
text = text.replace( /"dist\//g, "\"" );
fs.writeFileSync( filename, text, "utf-8" );
-
- // Use our hard-coded sourceMap directive instead of the autogenerated one (#13274; #13776)
- } else if ( /\.min\.js$/.test( filename ) ) {
- i = 0;
- text = text.replace( /(?:\/\*|)\n?\/\/@\s*sourceMappingURL=.*(\n\*\/|)/g,
- function( match ) {
- if ( i++ ) {
- return "";
- }
- return match;
- });
- fs.writeFileSync( filename, text, "utf-8" );
}
// Optionally copy dist files to other locations
diff --git a/build/tasks/uglify.js b/build/tasks/uglify.js
index 7c1a01bec..ccbc70888 100644
--- a/build/tasks/uglify.js
+++ b/build/tasks/uglify.js
@@ -38,12 +38,8 @@ module.exports = function( grunt ) {
// Rename the file to a temporary name.
fs.renameSync( mapFileName, mapping.dest);
grunt.file.write( mapFileName, grunt.file.read( mapping.dest )
- // The uglify task erroneously prepends dist/ to file names.
- .replace( /"dist\//g, "\"" )
// Refer to the source jquery.js, not the temporary jquery.pre-min.js.
- .replace( /\.pre-min\./g, "." )
- // There's already a pragma at the beginning of the file, remove the one at the end.
- .replace( /\/\/@ sourceMappingURL=jquery\.min\.map$/g, "" ));
+ .replace( /\.pre-min\./g, "." ));
});
// Remove temporary files.