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

Exported bindings are unexpectedly renamed. #267

Closed
mbostock opened this issue Nov 4, 2015 · 2 comments
Closed

Exported bindings are unexpectedly renamed. #267

mbostock opened this issue Nov 4, 2015 · 2 comments

Comments

@mbostock
Copy link
Contributor

mbostock commented Nov 4, 2015

Related #11, where you wrote:

I've changed some of the rewriting behaviour so that exported vars (or lets) are always rewritten as export.foo = .... Involves a little bit of dancing around, but I think it's the best solution. Hopefully I didn't introduce any bugs in the process.

Here’s my entry file I’m trying to rollup:

export {
  event,
  select,
  selectAll
} from "d3-selection";

The resulting code looks like this:

// initialization of event is incorrectly renamed “event$1”
exports.event$1 = null;

// likewise with assignment
function example(foo) {
  exports.event$1 = foo;
}

// then the initial value is copied into the exports object under the correct name
exports.event = exports.event$1;

So, two problems:

  • There’s an undesired export “event$1” which has the correct value.
  • The desired export “event” is always null.
@Rich-Harris
Copy link
Contributor

Much obliged – just published 0.20.4 with this fix (and a couple of others)

@mbostock
Copy link
Contributor Author

mbostock commented Nov 4, 2015

Thanks for the speedy release!

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

2 participants