Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…glify into fix-screw-ie8-option-crash
  • Loading branch information
avdg committed Dec 16, 2015
2 parents be7de43 + 12c7ded commit 71bf6f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 9 additions & 0 deletions tasks/lib/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ exports.init = function(grunt) {
if (options.compress.warnings !== true) {
options.compress.warnings = false;
}
if (options.screwIE8) {
options.compress.screw_ie8 = true;
}
var compressor = UglifyJS.Compressor(options.compress);
topLevel = topLevel.transform(compressor);

Expand Down Expand Up @@ -134,6 +137,12 @@ exports.init = function(grunt) {
}

if (options.mangle !== false) {
if (options.mangle === true) {
options.mangle = {};
}
if (options.screwIE8) {
options.mangle.screw_ie8 = true;
}
// disabled due to:
// 1) preserve stable name mangling
// 2) it increases gzipped file size, see https://github.com/mishoo/UglifyJS2#mangler-options
Expand Down
5 changes: 0 additions & 5 deletions tasks/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ module.exports = function(grunt) {
options.destToSourceMap = destToSourceMapPath + sourceMapBasename;
}

if (options.screwIE8) {
if (options.mangle) { options.mangle.screw_ie8 = true; }
if (options.compress) { options.compress.screw_ie8 = true; }
}

// Minify files, warn and fail on error.
var result;
try {
Expand Down

0 comments on commit 71bf6f5

Please sign in to comment.