Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Make ES6 Module Emit a "module" option #4806

Closed
weswigham opened this issue Sep 15, 2015 · 3 comments
Closed

Proposal: Make ES6 Module Emit a "module" option #4806

weswigham opened this issue Sep 15, 2015 · 3 comments
Labels
Fixed A PR has been merged for this issue In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@weswigham
Copy link
Member

I suggest we add "es6" as an option to the "module" flag, and the result of using it is getting ES6-style modules (import, export, and default keywords). It should be an error to choose "es6" as the module emit type when targeting below ES6. When targeting ES6 or above, this can remain the default module emit type.

A primary personal driver for this is bundling, as bundling to an ES6 module when targeting ES6 is awkward (but possible) but bundling to other formats while still using the remaining ES6 feature set is very desirable, and, additionally, plays well into starting to break things out for #4692. A real world use would be compiling targeting node 4 - it supports most of our ES6 features, but not ES6 modules, making our ES6 emit impossible to use without an additional transpiler. :(
Additionally, it would bring us inline with the systemjs builder's output options, which are amd, cjs, and es6.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 15, 2015

looks like a duplicate of #4389.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Sep 15, 2015
@weswigham
Copy link
Member Author

Its a tiny part of it (it did get mentioned as the main feature people wanted broken out) - and one of the easiest for us to enable in our present emitter.

@weswigham weswigham self-assigned this Sep 15, 2015
@mhegazy mhegazy added Suggestion An idea for TypeScript In Discussion Not yet reached consensus and removed Duplicate An existing issue was already created labels Sep 22, 2015
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Sep 28, 2015
@lazdmx
Copy link

lazdmx commented Oct 7, 2015

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants