Skip to content

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

Merged
merged 8 commits into from
Nov 26, 2015

Conversation

weswigham
Copy link
Member

Fixes #5594.

write(");");
}
else if (modulekind !== ModuleKind.ES6) {
write(`exports.default = `);
Copy link
Contributor

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"]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link

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)

enlight added a commit to debugworkbench/hydragon that referenced this pull request Nov 15, 2015
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.
@weswigham
Copy link
Member Author

@mhegazy do we want to merge this fix?

@mhegazy
Copy link
Contributor

mhegazy commented Nov 26, 2015

👍

@mhegazy
Copy link
Contributor

mhegazy commented Nov 26, 2015

sorry for the delay

weswigham added a commit that referenced this pull request Nov 26, 2015
Handle default class exports when targeting es6 with non-es6 module kinds
@weswigham weswigham merged commit ec775ba into microsoft:master Nov 26, 2015
@weswigham weswigham deleted the default-commonjs-es6 branch August 17, 2017 23:04
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants