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

Trouble with multiples exports #86

Open
christophedebatz opened this issue Apr 15, 2020 · 0 comments
Open

Trouble with multiples exports #86

christophedebatz opened this issue Apr 15, 2020 · 0 comments

Comments

@christophedebatz
Copy link

Hi,

I'm facing an issue with this plugin.

So in file a.js i've this code:

export default class Foo { };
export const bar = { buzz: 3 };

When I look at babel's plugin output, it is:

exports.default = Foo;
module.exports = exports.default;

So, in another file, I can easily call my class Foo by an import foo from './a'
But, I cannot call my second export bar, so when I type import { bar } from './a' and then console.log(bar.buzz) it throw an error Cannot read property 'buzz' of undefined.

The only "solution" I have is to add manually this:

module.exports.bar = exports.bar;

Obvioulsy, it's not a solution for me :-)

Any idea about this problem concerning the other export than the default one? Thanks,

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

1 participant