mirror of
https://github.com/jquery/jquery.git
synced 2024-12-09 08:04:24 +00:00
e24218758b
Also, as part of this, fix the `file` & `sources` properties of the source map file. Fixes gh-5285 Closes gh-5286 Ref gh-5258
18 lines
574 B
JavaScript
18 lines
574 B
JavaScript
"use strict";
|
|
|
|
var fs = require( "fs" );
|
|
|
|
module.exports = function( grunt ) {
|
|
var config = grunt.config( "minify.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 );
|
|
} );
|
|
};
|