mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
ac2da4e6b9
So far, only browser-based JS files were required to be in strict mode (in the
function form). This commit adds such a requirement to Node.js scripts where
the global form is preferred. All Node.js scripts in sloppy mode were
converted to strict mode.
Closes gh-4499
(cherry picked from commit bbad821c39
)
18 lines
574 B
JavaScript
18 lines
574 B
JavaScript
"use strict";
|
|
|
|
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 );
|
|
} );
|
|
};
|