Proposal: Make ES6 Module Emit a "module" option #4806
Labels
Fixed
A PR has been merged for this issue
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
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 areamd
,cjs
, andes6
.The text was updated successfully, but these errors were encountered: