Skip to content

Commit 42f1d9e

Browse files
committed
Build: Set correct minification options for uglify
Fixes #300 Closes #302
1 parent 98b61ad commit 42f1d9e

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

Gruntfile.js

+27-8
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,33 @@ module.exports = function( grunt ) {
7474
uglify: {
7575
all: {
7676
files: {
77-
"dist/jquery-migrate.min.js": [ "src/migratemute.js", "dist/jquery-migrate.js" ]
78-
}
79-
},
80-
options: {
81-
banner: "/*! jQuery Migrate v<%= pkg.version %>" +
82-
" | (c) <%= pkg.author.name %> | jquery.org/license */\n",
83-
beautify: {
84-
ascii_only: true
77+
"dist/jquery-migrate.min.js":
78+
[ "src/migratemute.js", "dist/jquery-migrate.js" ]
79+
},
80+
options: {
81+
preserveComments: false,
82+
sourceMap: true,
83+
sourceMapName: "dist/jquery-migrate.min.map",
84+
report: "min",
85+
output: {
86+
"ascii_only": true,
87+
88+
// Support: Android 4.0 only
89+
// UglifyJS 3 breaks Android 4.0 if this option is not enabled.
90+
// This is in lieu of setting ie8 for all of mangle, compress, and output
91+
"ie8": true
92+
},
93+
banner: "/*! jQuery Migrate v<%= pkg.version %>" +
94+
" | (c) <%= pkg.author.name %> | jquery.org/license */",
95+
compress: {
96+
"hoist_funs": false,
97+
loops: false,
98+
99+
// Support: IE <11
100+
// typeofs transformation is unsafe for IE9-10
101+
// See https://github.com/mishoo/UglifyJS2/issues/2198
102+
typeofs: false
103+
}
85104
}
86105
}
87106
},

test/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</script>
2020
<script>
2121
jQuery.noConflict();
22-
TestManager.loadProject( "jquery-migrate", "dev", true );
22+
TestManager.loadProject( "jquery-migrate", "min", true );
2323
</script>
2424

2525
<!-- Version comparisons -->

0 commit comments

Comments
 (0)