coderaiser/minify

--js flag seems to be broken

Closed this issue · 5 comments

am97 commented

Hello,

Since minify v5.2.0, the --js flag seems to no longer work. For example:

$ cat << EOT > hello.js
const hello = 'world';

for (let i = 0; i < hello.length; i++) {
    console.log(hello[i]);
}
EOT
$ cat hello.js | minify --js
Promise { <pending> }

With minify v5.1.1 I get the expected result:

$ cat hello.js | minify --js
const hello="world";for(let l=0;l<hello.length;l++)console.log(hello[l]);

A workaround for minify v5.2.0 and v6.0.0 is to not use the --js flag

$ minify hello.js 
const hello="world";for(let l=0;l<hello.length;l++)console.log(hello[l]);

Thank you :), fixed with ba496f3, landed in v6.0.1 🎉 .
Is it works for you?

am97 commented

Yes, it is working now, thank you !

Same issue on 11.2.1

@vitek-dev how it works for you?

I cannot reproduce this:

coderaiser@localcmd:~/minify$ echo 'if (a) alert()' | minify --js
a&&alert();