-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Handle default class exports when targeting es6 with non-es6 module kinds #5648
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
Conversation
write(");"); | ||
} | ||
else if (modulekind !== ModuleKind.ES6) { | ||
write(`exports.default = `); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in ES3 we should emit this as exports["defualt"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be regular quotation marks? (no embedded variables)
TypeScript 1.8 doesn't correctly transpile default ES6 exports when targeting ES6 + CommonJS. This is a known issue and there's a pending PR to fix it (microsoft/TypeScript#5648). Until then I'm going to make do without default exports.
@mhegazy do we want to merge this fix? |
👍 |
sorry for the delay |
Handle default class exports when targeting es6 with non-es6 module kinds
Fixes #5594.