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 { default } from "external-x" fails in non-ESM formats #2977

Closed
aapoalas opened this issue Jul 2, 2019 · 3 comments · Fixed by #3084
Closed

export { default } from "external-x" fails in non-ESM formats #2977

aapoalas opened this issue Jul 2, 2019 · 3 comments · Fixed by #3084

Comments

@aapoalas
Copy link

aapoalas commented Jul 2, 2019

  • Rollup Version: 1.15.1
  • Operating System (or Browser): Ubuntu 14.04
  • Node Version: 8.10.0

How Do We Reproduce?

Link to Repl

Simple explanation: Re-exporting the default of an external module doesn't work.

Expected Behavior

If 'interop' is on, then the interop function should unwrap the default value and that value should then be returned (AMD module) / assigned to exports (CJS module) / ...

If 'interop' is off, then no unwrap should be done and the value from the module should be returned / assigned to exports as-is.

Actual Behavior

The 'interop' function unwraps the default value. Then value.default is returned / assigned to exports.

While I'm here

My use-case for Rollup has recently been with compiling ESM files into single AMD modules for use. The usage of these AMD modules does not care at all about original ESM format of the data and as such a simple return statement is enough. Occasionally, still, Rollup has been adding "exports" into the dependencies and using that as the means of output. It would be nice if there was a way to forbid this. But that's not really in any way connected with this bug report. Sorry about that.

@lukastaegert
Copy link
Member

I’m working on a fix for this but due to other issues it may take another week to complete.

@lukastaegert
Copy link
Member

Fix at #3084

@aapoalas
Copy link
Author

Cool, thank you!

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

Successfully merging a pull request may close this issue.

2 participants