Skip to content
New issue

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

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

Already on GitHub? # to your account

[Feature Request] Remove add-module-exports babel plugin #82

Closed
amanmahajan7 opened this issue Sep 29, 2017 · 2 comments
Closed

[Feature Request] Remove add-module-exports babel plugin #82

amanmahajan7 opened this issue Sep 29, 2017 · 2 comments

Comments

@amanmahajan7
Copy link

add-module-exports plugin mimics babel-5 behavior and adds a magic module.exports = exports['default']; statement if the module only has default export. Although this is convenient but it is not the correct behavior and Babel 6 has removed this hack.

This problem is clearly explained on stackoverflow

https://github.com/59naga/babel-plugin-add-module-exports

Due to this plugin, react-measure default export is undefined when used with TypeScript (at least in my project). If we really need to preserve the old behavior then having multiple bundles (UMD, UMD-legacy, ES6) would be really helpful

Thanks

@amanmahajan7
Copy link
Author

amanmahajan7 commented Sep 29, 2017

Here is more info
microsoft/TypeScript#5565 (comment)

@jrmyio
Copy link

jrmyio commented Feb 22, 2018

Also ran into this error:
#37 (comment)

Using:

import * as ReactMeasure from "react-measure";
const Measure: any = (ReactMeasure as any).Measure;

to work around the error but I obviously loose type checking.

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

No branches or pull requests

2 participants