Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Recent uglify changes cause errors on older browsers #288

Closed
@adregan

Description

@adregan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions