minislides icon indicating copy to clipboard operation
minislides copied to clipboard

Better compression by using ES6 features

Open ThomasR opened this issue 8 years ago • 0 comments

All currently supported browsers are more or less ES6 compatible. So:

  • Instead of function, use =>
  • ~~Replace .map.call(foo, function(bar){…}); by `for (let bar of foo) {…}``~~ see Chromium bug
  • Use template string (in case of 'a'+b+'c' -> a${b}c, not in case of 'a'+b or b+'c', since that yields no advantage)

Unfortunately, neither uglifyjs nor esprima/esmangle/escodegen support this. There are four options:

  • Wait for estools / uglifyjs to implement that stuff
  • Fork and implement the required features
  • Use a totally different tool (Some transpiler? Babel Plugin? Traceur?)
  • Manually edit the minified result

ThomasR avatar Mar 19 '16 14:03 ThomasR