rossmartin / cordova-uglify

Cordova hook that allows you to uglify or minify your apps JavaScript and CSS.
MIT License
116 stars 46 forks source link

Support ES6 #51

Closed jfoclpf closed 3 years ago

jfoclpf commented 3 years ago

This package could also support ES6, for that you just need to change from uglify-js to uglify-es They have the same syntax, so, you just need to change your package.json

rossmartin commented 3 years ago

Thank you for your comment here and the other issue. uglify-es has been abandoned. This hook did use it for a brief time before moving back to uglify-js.

jfoclpf commented 3 years ago

Where do you see that uglify-es has been abandoned? There is no reference for that on the npm page: https://www.npmjs.com/package/uglify-es

I'm asking because I use it for my projects

Just last week it got 1,3 million downloads, it really does not seem abandoned

image

jfoclpf commented 3 years ago

Ah, ok, I saw now. For ES6 compatibility you can use terser

If Cordova build supports ES6, it's a pity that your module does not support ES6

uglify-es has been forked and the new project is called terser. For projects that need ES6 support, use it instead of uglify-es, since all new development will be happening over there (and things like webpack are switching over to it shortly too): https://github.com/fabiosantoscode/terser