12

The descriptions of uglify-js and uglify-es are the same except that uglify-es tacks "for ES6+" on the end. Based on that one would think uglify-es is the best option for ES6 code. On the other hand, uglify-es is older - version 3.3.9 published 5 months ago, versus uglify-js at version 3.4.2 published 2 days ago. Anyone want to clear up my confusion?

Qwertie
  • 16,354
  • 20
  • 105
  • 148
  • With uglify-js you need to transpile your ES6 code (babel) with uglify-es should be stright forward. Im not sure the versions between uglify-js and uglify-es being symetric but as far as I know. I have an old app (jquery) and I use uglify-es to minfy and uglify the code instead of new apps that uses webpack (which will take care of the js and the css) – M. Gara Jun 29 '18 at 03:50
  • According to the talk [Building a Platform: Webpack and the Future](https://youtu.be/nzb-dgNaImI?t=7m56s), uglify-es comes with (better?) parallelism and caching, resulting in a significant speedup for Webpack 4. – CodeManX Aug 24 '18 at 09:14

1 Answers1

28

uglify-js only supports ES5 code as input.

uglify-es also supports ES6, but is buggy and has been abandoned.

terser is a maintained replacement for it that can also handle ES6+.

Dan Abramov
  • 264,556
  • 84
  • 409
  • 511