Skip to content

Commit d0fadbb

Browse files
committed
Remove workarounds for the uglify task mishandling banners when used with source maps.
The issue was fixed in grunt-contrib-uglify: gruntjs/grunt-contrib-uglify#22
1 parent 85d4c01 commit d0fadbb

File tree

3 files changed

+11
-76
lines changed

3 files changed

+11
-76
lines changed

Gruntfile.js

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = function( grunt ) {
55
var data = {};
66
try {
77
data = grunt.file.readJSON( filepath );
8-
} catch(e) {}
8+
} catch ( e ) {}
99
return data;
1010
}
1111

@@ -17,8 +17,8 @@ module.exports = function( grunt ) {
1717
delete srcHintOptions.onevar;
1818

1919
grunt.initConfig({
20-
pkg: grunt.file.readJSON("package.json"),
21-
dst: readOptionalJSON("dist/.destination.json"),
20+
pkg: grunt.file.readJSON( "package.json" ),
21+
dst: readOptionalJSON( "dist/.destination.json" ),
2222
compare_size: {
2323
files: [ "dist/jquery.js", "dist/jquery.min.js" ],
2424
options: {
@@ -89,54 +89,35 @@ module.exports = function( grunt ) {
8989
tasks: "build/tasks/*.js"
9090
},
9191
testswarm: {
92-
tests: "ajax attributes callbacks core css data deferred dimensions effects event manipulation offset queue selector serialize support traversing Sizzle".split(" ")
92+
tests: "ajax attributes callbacks core css data deferred dimensions effects event manipulation offset queue selector serialize support traversing Sizzle".split( " " )
9393
},
9494
watch: {
9595
files: [ "<%= jshint.grunt.src %>", "<%= jshint.tests.src %>", "src/**/*.js" ],
9696
tasks: "dev"
9797
},
98-
"pre-uglify": {
99-
all: {
100-
files: {
101-
"dist/jquery.pre-min.js": [ "dist/jquery.js" ]
102-
},
103-
options: {
104-
banner: "\n\n\n\n\n\n\n\n\n\n\n\n" + // banner line size must be preserved
105-
"/*! jQuery v<%= pkg.version %> | " +
106-
"(c) 2005, 2013 jQuery Foundation, Inc. | " +
107-
"jquery.org/license */\n"
108-
}
109-
}
110-
},
11198
uglify: {
11299
all: {
113100
files: {
114-
"dist/jquery.min.js": [ "dist/jquery.pre-min.js" ]
101+
"dist/jquery.min.js": [ "dist/jquery.js" ]
115102
},
116103
options: {
117-
// Keep our hard-coded banner
118-
preserveComments: "some",
104+
preserveComments: false,
119105
sourceMap: "dist/jquery.min.map",
120106
sourceMappingURL: "jquery.min.map",
121107
report: "min",
122108
beautify: {
123109
ascii_only: true
124110
},
111+
banner: "/*! jQuery v<%= pkg.version %> | " +
112+
"(c) 2005, 2013 jQuery Foundation, Inc. | " +
113+
"jquery.org/license */",
125114
compress: {
126115
hoist_funs: false,
127116
loops: false,
128117
unused: false
129118
}
130119
}
131120
}
132-
},
133-
"post-uglify": {
134-
all: {
135-
src: [ "dist/jquery.min.map" ],
136-
options: {
137-
tempFiles: [ "dist/jquery.pre-min.js" ]
138-
}
139-
}
140121
}
141122
});
142123

@@ -150,5 +131,5 @@ module.exports = function( grunt ) {
150131
grunt.registerTask( "dev", [ "build:*:*", "jshint", "jscs" ] );
151132

152133
// Default grunt
153-
grunt.registerTask( "default", [ "jsonlint", "dev", "pre-uglify", "uglify", "post-uglify", "dist:*", "compare_size" ] );
134+
grunt.registerTask( "default", [ "jsonlint", "dev", "uglify", "dist:*", "compare_size" ] );
154135
};

build/tasks/uglify.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"grunt": "~0.4.1",
3333
"grunt-compare-size": "~0.4.0",
3434
"grunt-contrib-jshint": "~0.7.0",
35-
"grunt-contrib-uglify": "~0.2.4",
35+
"grunt-contrib-uglify": "~0.2.7",
3636
"grunt-contrib-watch": "~0.5.3",
3737
"grunt-git-authors": "~1.2.0",
3838
"grunt-jscs-checker": "~0.2.3",

0 commit comments

Comments
 (0)