mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 18:35:03 -05:00
Release: remove sourcemap comment from all copies of minified file
Fixes gh-1707
This commit is contained in:
@@ -44,12 +44,6 @@ function makeReleaseCopies( Release ) {
|
||||
"\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js" ) +
|
||||
"\",\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
|
||||
fs.writeFileSync( releaseFile, text );
|
||||
} else if ( /\.min\.js$/.test( releaseFile ) ) {
|
||||
// Remove the source map comment; it causes way too many problems.
|
||||
// Keep the map file in case DevTools allow manual association.
|
||||
text = fs.readFileSync( builtFile, "utf8" )
|
||||
.replace( /\/\/# sourceMappingURL=\S+/, "" );
|
||||
fs.writeFileSync( releaseFile, text );
|
||||
} else if ( builtFile !== releaseFile ) {
|
||||
shell.cp( "-f", builtFile, releaseFile );
|
||||
}
|
||||
|
||||
13
build/tasks/sourcemap.js
Normal file
13
build/tasks/sourcemap.js
Normal file
@@ -0,0 +1,13 @@
|
||||
var fs = require( "fs" );
|
||||
|
||||
module.exports = function( grunt ) {
|
||||
var minLoc = Object.keys( grunt.config( "uglify.all.files" ) )[ 0 ];
|
||||
grunt.registerTask( "remove_map_comment", function() {
|
||||
// Remove the source map comment; it causes way too many problems.
|
||||
// The map file is still generated for manual associations
|
||||
// https://github.com/jquery/jquery/issues/1707
|
||||
var text = fs.readFileSync( minLoc, "utf8" )
|
||||
.replace( /\/\/# sourceMappingURL=\S+/, "" );
|
||||
fs.writeFileSync( minLoc, text );
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user