Skip to content
This repository was archived by the owner on Mar 29, 2018. It is now read-only.
This repository was archived by the owner on Mar 29, 2018. It is now read-only.

Module bindings are not propagated across multiple modules when using import * as syntax #189

@Pauan

Description

@Pauan

Consider these three modules:

// foo.js
export var foo = 5;

// bar.js
import { foo } from "./foo";
export { foo };

// qux.js
import * as bar from "./bar";
console.log(bar.foo);

Using the "bundle" format of es6-module-transpiler version 0.9.6, I get this output:

(function() {
    "use strict";

    var $$bar$$ = {
        get foo() {
            return $$bar$$foo;
        }
    };

    var $$foo$$foo = 5;
    console.log($$bar$$.foo);
}).call(this);

//# sourceMappingURL=build.js.map

As you can see, it incorrectly uses the variable $$bar$$foo, rather than the correct variable $$foo$$foo.

If I change qux.js to this, then it works correctly:

import { foo } from "./bar";
console.log(foo);

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions