jquery/build/tasks/sourcemap.js
Timmy Willison cf7102c3f1 Release: push a custom slim build to the CDN
Fixes gh-2653
Close gh-2711
2015-11-16 11:22:20 -05:00

16 lines
559 B
JavaScript

var fs = require( "fs" );
module.exports = function( grunt ) {
var config = grunt.config( "uglify.all.files" );
grunt.registerTask( "remove_map_comment", function() {
var minLoc = grunt.config.process( Object.keys( config )[ 0 ] );
// 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 );
} );
};