Skip to content

Support "target": "es6" in tsconfig.json #6370

@hotforfeature

Description

@hotforfeature

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions.

@angular/cli: 1.0.3
node: 6.9.5
os: darwin x64

Repro steps.

Change tsconfig.json "target" to "ES6" and run ng build --prod. UglifyJS will cause an error and the build will fail.

The log given by the failure.

ERROR in main.87940961b85a05fb6d79.bundle.js from UglifyJs
Unexpected token: name (CoreModule) [main.87940961b85a05fb6d79.bundle.js:29,6]

Desired functionality.

Either the CLI should replace the UglifyJS plugin with an ES6-compatible plugin (such as Babili) or the CLI should disable minifying when the target is ES6.

Another option would be to expose a flag to developers to disable minifying.

Mention any other details that might be useful.

#5730 #5352 #4554 and #3191 are all issues that have been closed because the CLI does not support an ES6 target.

There is no open issue to track ES6 support, and with over 1 billion devices supporting ES6 with Chrome and Safari, it does not make sense to limit developers to ES5 compiled code when the workaround is as easy as opting out of minifying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussioneffort2: medium (days)severity2: inconvenient

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions