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

Transformed export statement from global exports are wrong, when re exported from module. #1675

Closed
cebor opened this issue Oct 14, 2017 · 10 comments

Comments

@cebor
Copy link

cebor commented Oct 14, 2017

The following example shows, when i re export a global export from a module the export statement in the result is wrong.

// I would expect something like this
import * as highcharts from 'highcharts';
export { highcharts as Highcharts };

// But get this
export { Highcharts } from 'highcharts';

Highcharts is declared as external module and has no explicit named exports, so only the global export with the * works.

Example:
https://rollupjs.org/repl?version=0.51.1&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmV4cG9ydCUyMCU3QiUyMEhpZ2hjaGFydHMlMjAlN0QlMjBmcm9tJTIwJy4lMkZpbmRleCclMjIlN0QlMkMlN0IlMjJuYW1lJTIyJTNBJTIyaW5kZXguanMlMjIlMkMlMjJjb2RlJTIyJTNBJTIyaW1wb3J0JTIwKiUyMGFzJTIwSGlnaGNoYXJ0cyUyMGZyb20lMjAnaGlnaGNoYXJ0cyclNUNuZXhwb3J0JTIwJTdCJTIwSGlnaGNoYXJ0cyUyMCU3RCUyMiU3RCU1RCUyQyUyMm9wdGlvbnMlMjIlM0ElN0IlMjJmb3JtYXQlMjIlM0ElMjJlcyUyMiUyQyUyMmdsb2JhbHMlMjIlM0ElN0IlN0QlMkMlMjJuYW1lJTIyJTNBJTIybXlCdW5kbGUlMjIlMkMlMjJhbWQlMjIlM0ElN0IlMjJpZCUyMiUzQSUyMiUyMiU3RCU3RCUyQyUyMmV4YW1wbGUlMjIlM0FudWxsJTdE

@cebor
Copy link
Author

cebor commented Nov 8, 2017

Issue still in v0.51.1

@lukastaegert
Copy link
Member

Hi @cebor,

thanks for this issue and sorry you have been waiting for some time. After the easier issues caused by the recent release are settled, I plan on digging deeper into the dependency resolution algorithm, there are more issues like this one that need to be addressed.
Just be sure that you are not forgotten here!

@guybedford
Copy link
Contributor

This is a special case that requires the generation of a temporary variable. We can certainly add this.

@guybedford
Copy link
Contributor

(Although this would be much easier to support with the export * as x from 'y' proposal! - https://github.com/tc39/proposal-export-ns-from)

@guybedford
Copy link
Contributor

I'm looking into reworking the code around this case as well as some other reexports scenarios. Should hopefully have a PR up soon.

@guybedford
Copy link
Contributor

Should be fixed by #1947.

@guybedford
Copy link
Contributor

Fixed in 0.55.4.

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

No branches or pull requests

3 participants