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

Export ES6 default property in CommonJS and global object #493

Merged
merged 1 commit into from
Sep 6, 2017

Conversation

Deraen
Copy link
Contributor

@Deraen Deraen commented Sep 6, 2017

In Babel 5, the ES6 default property was exported as both default
property under the CommonJS export (module.exports) and global object
(in UMD wrapper, on browser). With babel 6 this behaviour was changed
(babel/babel#2212) and now using library
requires e.g.

require("react-modal").default instead of just require("react-modal")
ReactModal.default instead of ReactModal

This babel plugin restores the old behaviour.

Fixes #470

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 87.404% when pulling 3a7febc on Deraen:master into ba526cf on reactjs:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 87.404% when pulling 3a7febc on Deraen:master into ba526cf on reactjs:master.

@diasbruno
Copy link
Collaborator

diasbruno commented Sep 6, 2017

Hi @Deraen, thank you! You can remove the dist/* files because they are generated
when we publish a new version.

In Babel 5, the ES6 default property was exported as both default
property under the CommonJS export (module.exports) and global object
(in UMD wrapper, on browser). With babel 6 this behaviour was changed
(babel/babel#2212) and now using library
requires e.g.

require("react-modal").default instead of just require("react-modal")
ReactModal.default instead of ReactModal

This babel plugin restores the old behaviour.
@Deraen
Copy link
Contributor Author

Deraen commented Sep 6, 2017

@diasbruno Done

@diasbruno
Copy link
Collaborator

Thank you! I'll publish a new version later today.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 87.404% when pulling 52767c7 on Deraen:master into ba526cf on reactjs:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 87.404% when pulling 52767c7 on Deraen:master into ba526cf on reactjs:master.

@diasbruno diasbruno merged commit 54c59c5 into reactjs:master Sep 6, 2017
@diasbruno
Copy link
Collaborator

Released v2.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants