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

add __esModule: true when exports #167

Closed
wants to merge 1 commit into from

Conversation

doxiaodong
Copy link

@doxiaodong doxiaodong commented Jun 21, 2018

When I use import * as classnames from 'classnames' and babel, And it throw classnames is not a function.

since babel _interopRequireWildcard doesn't do the right copy to the new newObj
when the module.exports is a function

and classnames is actually a function exports

see babel/babel#3956
and https://github.com/babel/babel/blob/master/packages/babel-helpers/src/helpers.js#L544

since babel _interopRequireWildcard doesn't do the right copy to the new newObj
when the module.exports is a function

and classnames is actually a function exports
@doxiaodong
Copy link
Author

By the way, the reason I use import * as classnames from 'classnames' rather than default import is https://github.com/mradamczyk/DefinitelyTyped/blob/fae50ad424116d7179e9e9d20651ba17ad229d84/types/classnames/index.d.ts#L24

@dcousens
Copy link
Collaborator

See #150 (preferred)

@dcousens dcousens closed this Jul 20, 2018
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.

2 participants