string-similarity icon indicating copy to clipboard operation
string-similarity copied to clipboard

incompatible with uglifyjs

Open evgenyfadeev opened this issue 6 years ago • 8 comments

Hello, I'm getting this when building the productio package

....... from UglifyJs Unexpected token: punc (,) ....

Perhaps there is a way to add build configuration to the package to fix this? I've gone around by copying the code in my utilities library. Thanks!

evgenyfadeev avatar Nov 28 '18 16:11 evgenyfadeev

Don't know enough about Uglify, sorry. Does it support ES6? That might be the difference. Try using the latest version 1.x of string-similarity which is ES5 to verify.

aceakash avatar Nov 29 '18 21:11 aceakash

uglify does not support es6, so I thought you might add a build config to transpile the code to es5...

evgenyfadeev avatar Nov 29 '18 21:11 evgenyfadeev

Fair enough @evgenyfadeev, I'm open to any PRs for build config.

aceakash avatar Nov 30 '18 10:11 aceakash

@aceakash @evgenyfadeev Actually, terser supports minification of ES6. :ok_hand: I've used it with rollup in scrolldir-observable.

janriemer avatar Jan 03 '19 22:01 janriemer

From terser

Why choose terser? uglify-es is no longer maintained and uglify-js does not support ES6+. terser is a fork of uglify-es that retains API and CLI compatibility with uglify-es and uglify-js@3.

balazsorban44 avatar Jan 30 '19 15:01 balazsorban44

bump

sitch avatar Mar 15 '19 00:03 sitch

es6 has been out for almost 5 years. why go through the trouble of supporting uglify-js? don't enable outdated code.

ljmerza avatar Jan 09 '20 19:01 ljmerza

Isn't this PR adding support for ES6 with babel? Can it be merged?

janriemer avatar Jan 11 '20 23:01 janriemer