Skip to content

Exported bindings are unexpectedly renamed. #267

Description

@mbostock

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions