2019-10-08 22:17:55 +00:00
|
|
|
"use strict";
|
|
|
|
|
2015-01-30 20:22:25 +00:00
|
|
|
var fs = require( "fs" );
|
|
|
|
|
|
|
|
module.exports = function( grunt ) {
|
2023-07-10 16:23:07 +00:00
|
|
|
var config = grunt.config( "minify.all.files" );
|
2015-01-30 20:22:25 +00:00
|
|
|
grunt.registerTask( "remove_map_comment", function() {
|
2015-11-12 18:18:59 +00:00
|
|
|
var minLoc = grunt.config.process( Object.keys( config )[ 0 ] );
|
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
|
|
|
};
|