Permalink
Browse files

fix(bundler): bypass a nasty terser compress bug by using fast-minify…

…-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...
huochunpeng committed Oct 14, 2018
1 parent 9ebe10a commit 7a37238bc7411e6b052cad388892c3f4163e5853
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/build/bundle.js
@@ -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') {

0 comments on commit 7a37238

Please sign in to comment.