Recent uglify changes cause errors on older browsers #288
Description
This recent PR—specifically, the change to the uglify options—causes errors in older browsers (namely IE11) in certain situations.
For example, if uglify (with its config on ecma: 8
) receives an object like:
{ foo: foo, bar: bar, baz: baz }
it will convert the object to:
{ foo, bar, baz }
causing a syntax error Expected ':'
.
NOTE: this happens most reliably with the
window
object as uglify won't mangle its name.
Currently, we are getting around this issue with a webpack override that changes the ecma
setting to 5
rather than 8
, but as I suspect others might have this issue as well, a formal option might be nice.
Alternatively, I think there is room to discuss whether transpiling code is beyond the responsibility of an uglifier. Especially if an explicit target is set in the tsconfig (we target our compiled typescript to es5, and would prefer if the uglifier respected that).
Thanks for all the hard work! I'm very grateful to be able to use typescript and create-react-app together.