aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2013-11-09 23:12:06 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2013-11-09 23:12:06 +0100
commitd0fadbba9f1dbe2ee009be6586fbdf3cda4eff98 (patch)
treee8d5f58091acba372c6dfebc92628d1df3638756 /build
parent85d4c0133b5369b54bc9c4250989214bb2d45700 (diff)
downloadjquery-d0fadbba9f1dbe2ee009be6586fbdf3cda4eff98.tar.gz
jquery-d0fadbba9f1dbe2ee009be6586fbdf3cda4eff98.zip
Remove workarounds for the uglify task mishandling banners when used with source maps.
The issue was fixed in grunt-contrib-uglify: https://github.com/gruntjs/grunt-contrib-uglify/issues/22
Diffstat (limited to 'build')
-rw-r--r--build/tasks/uglify.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/build/tasks/uglify.js b/build/tasks/uglify.js
deleted file mode 100644
index f8df5e77e..000000000
--- a/build/tasks/uglify.js
+++ /dev/null
@@ -1,46 +0,0 @@
-module.exports = function( grunt ) {
-
- "use strict";
-
- var fs = require( "fs" );
-
- // Work around grunt-contrib-uglify sourceMap issues (jQuery #13776)
- grunt.registerMultiTask( "pre-uglify", function() {
- var banner = this.options().banner;
-
- this.files.forEach(function( mapping ) {
- // Join src
- var input = mapping.src.map(function( file ) {
- var contents = grunt.file.read( file );
-
- // Strip banners
- return contents
- // Remove the main jQuery banner, it'll be replaced by the new banner anyway.
- .replace( /^\/\*![\W\w]*?\*\/\n?/g, "" )
- // Strip other banners preserving line count.
- .replace( /^\/\*!(?:.|\n)*?\*\/\n?/gm, function( match ) {
- return match.replace( /[^\n]/gm, "" );
- });
- }).join( "\n" );
-
- // Write temp file (with optional banner)
- grunt.file.write( mapping.dest, ( banner || "" ) + input );
- });
- });
-
- // Change the map file to point back to jquery.js instead of jquery.pre-min.js.
- // The problem is caused by the pre-uglify task.
- grunt.registerMultiTask( "post-uglify", function() {
- this.files.forEach(function( mapping ) {
- mapping.src.forEach( function( src ) {
- // Refer to the source jquery.js, not the temporary jquery.pre-min.js.
- grunt.file.write( src, grunt.file.read( src ).replace( /\.pre-min\./g, "." ) );
- });
- });
-
- // Remove temporary files.
- this.options().tempFiles.forEach(function( fileName ) {
- fs.unlink( fileName );
- });
- });
-};