2015-01-30 20:22:25 +00:00
|
|
|
var fs = require( "fs" );
|
|
|
|
|
|
|
|
module.exports = function( grunt ) {
|
|
|
|
var minLoc = Object.keys( grunt.config( "uglify.all.files" ) )[ 0 ];
|
|
|
|
grunt.registerTask( "remove_map_comment", function() {
|
2015-08-16 06:59:58 +00:00
|
|
|
|
2015-01-30 20:22:25 +00:00
|
|
|
// 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 );
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|
2015-01-30 20:22:25 +00:00
|
|
|
};
|