Skip to content

Commit dfaee32

Browse files
committed
Fix #13983. Switch to //# for sourcemap directives.
1 parent 58a5040 commit dfaee32

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

Gruntfile.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,10 @@ module.exports = function( grunt ) {
8585
"dist/jquery.pre-min.js": [ "dist/jquery.js" ]
8686
},
8787
options: {
88-
banner: "\n\n\n\n\n\n\n\n\n\n" + // banner line size must be preserved
88+
banner: "\n\n\n\n\n\n\n\n\n\n\n\n" + // banner line size must be preserved
8989
"/*! jQuery v<%= pkg.version %> | " +
9090
"(c) 2005, 2013 jQuery Foundation, Inc. | " +
91-
"jquery.org/license\n" +
92-
"//@ sourceMappingURL=jquery.min.map\n" +
93-
"*/\n"
91+
"jquery.org/license */\n"
9492
}
9593
}
9694
},

build/tasks/dist.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,6 @@ module.exports = function( grunt ) {
5757
if ( /\.map$/.test( filename ) ) {
5858
text = text.replace( /"dist\//g, "\"" );
5959
fs.writeFileSync( filename, text, "utf-8" );
60-
61-
// Use our hard-coded sourceMap directive instead of the autogenerated one (#13274; #13776)
62-
} else if ( /\.min\.js$/.test( filename ) ) {
63-
i = 0;
64-
text = text.replace( /(?:\/\*|)\n?\/\/@\s*sourceMappingURL=.*(\n\*\/|)/g,
65-
function( match ) {
66-
if ( i++ ) {
67-
return "";
68-
}
69-
return match;
70-
});
71-
fs.writeFileSync( filename, text, "utf-8" );
7260
}
7361

7462
// Optionally copy dist files to other locations

build/tasks/uglify.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ module.exports = function( grunt ) {
3838
// Rename the file to a temporary name.
3939
fs.renameSync( mapFileName, mapping.dest);
4040
grunt.file.write( mapFileName, grunt.file.read( mapping.dest )
41-
// The uglify task erroneously prepends dist/ to file names.
42-
.replace( /"dist\//g, "\"" )
4341
// Refer to the source jquery.js, not the temporary jquery.pre-min.js.
44-
.replace( /\.pre-min\./g, "." )
45-
// There's already a pragma at the beginning of the file, remove the one at the end.
46-
.replace( /\/\/@ sourceMappingURL=jquery\.min\.map$/g, "" ));
42+
.replace( /\.pre-min\./g, "." ));
4743
});
4844

4945
// Remove temporary files.

0 commit comments

Comments
 (0)