Closed haifeng239 closed 6 years ago
dig some digging. looks like uglifyjs released uglify-es
uglify-es
Here's an example of code that breaks with uglify-js but works with uglify-es
var uglify = require('uglify-es'); fn = function () { var world = 'world'; return `hello ${world}`; } input = "var ___ = " + fn.toString(); output = uglify.minify(input) if(output.error) { console.log(output.error); } else { output = output.code output = output.replace('var ___=', ''); output = output.replace(/;$/, ''); } console.log(input); console.log(output);
downgraded my coffee script to 1.x so it doesn't compile with ES6. This is less of a concern for me now.
looks like you already did this. closing issue
dig some digging. looks like uglifyjs released
uglify-es
Here's an example of code that breaks with uglify-js but works with uglify-es