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 __esModule when bundling to CJS or UMD in named mode. #650

Closed
cameron-martin opened this issue May 12, 2016 · 3 comments
Closed

Export __esModule when bundling to CJS or UMD in named mode. #650

cameron-martin opened this issue May 12, 2016 · 3 comments

Comments

@cameron-martin
Copy link
Contributor

When the format option is set to 'umd' or 'cjs' and the exports option is set to 'named', we should automatically export the __esModule property (with value true).

This means that a library compiled using rollup can be imported using an app which uses ES6 syntax for imports, then compiles to CommonJS using babel.

Can anyone see any downsides to doing this? If not, I'd be happy to submit a pull request.

@eventualbuddha
Copy link
Contributor

We should do that. I've been meaning to for a long time.

@Rich-Harris
Copy link
Contributor

This is enabled in 0.26.7 – thanks

@ericf
Copy link
Contributor

ericf commented Jun 21, 2016

I've started receiving some issues people ran into with because of this change. They were incorrectly importing the default export of React Intl which does not have a default export, then accessing a named export off of it.

Obviously the user's import statements are incorrect, but I just wanted to point this out since @cameron-martin asked about potential downsides.

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

No branches or pull requests

4 participants