We use Jekyll Assets with great passion in our static sites but we've been getting continually frustrated with Uglifier not supporting ES6 syntax like below:
class ExampleClass {
static get values() {
}
onBlur = (event) => {
}
}
As it means we have to define them manually using defineProperty like so:
function _defineProperty(obj, key, value, accessor) {
if (accessor == "getter") {
Object.defineProperty(obj, key, {
get: value,
enumerable: true,
configurable: true,
});
} else if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
// define a getter
_defineProperty(ExampleClass, 'values', () => {}, 'getter');
// define a method
class ExampleClass {
constructor(...args) {
super(...args);
_defineProperty(this, "onBlur", event => {});
}
}
I've raised this as an issue with UglifyJS but they don't seem to be doing a very good job of supporting the modern syntax...
How feasible is it to replace Uglifier with something more modern that understands ES6 syntax properly?
We use Jekyll Assets with great passion in our static sites but we've been getting continually frustrated with Uglifier not supporting ES6 syntax like below:
As it means we have to define them manually using
definePropertylike so:I've raised this as an issue with UglifyJS but they don't seem to be doing a very good job of supporting the modern syntax...
How feasible is it to replace Uglifier with something more modern that understands ES6 syntax properly?