Skip to content

Commit

Permalink
fix(bundler): bypass a nasty terser compress bug by using fast-minify…
Browse files Browse the repository at this point in the history
…-mode

The original code supposed to use fast-minify-mode, but somehow it did not. This fix turns on fast-minify-mode, that disables compress. The resulting minified size is surprisingly almost as small as normal mode, but it only uses a quarter of the time. https://github.com/terser-js/terser#terser-fast-minify-mode

closes #928
  • Loading branch information
3cp committed Oct 14, 2018
1 parent 9ebe10a commit 7a37238
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ exports.Bundle = class {
// Terser fast minify mode
// https://github.com/fabiosantoscode/terser#terser-fast-minify-mode
// It's a good balance on size and speed to turn off compress.
let minificationOptions = {compress: true};
// Turn off compress also bypasses https://github.com/terser-js/terser/issues/120
let minificationOptions = {compress: false};

let minifyOptions = buildOptions.getValue('minify');
if (typeof minifyOptions === 'object') {
Expand Down

0 comments on commit 7a37238

Please sign in to comment.