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

[Refactor] Support exposing ESM without harmony export #56

Closed
benirose opened this issue Nov 7, 2017 · 3 comments · Fixed by #100
Closed

[Refactor] Support exposing ESM without harmony export #56

benirose opened this issue Nov 7, 2017 · 3 comments · Fixed by #100

Comments

@benirose
Copy link

benirose commented Nov 7, 2017

I'm using expose-loader to expose some ES6 modules, which are currently using export default {...}, however instead of getting the resource at my exposed variable, it's at module.default. Here's my require:

require("expose-loader?Store!./store/index.js");

And here's my export:

export default new Vuex.Store({
...
})

My module is now exposed at Store.default.

Is this just a side effect of ES6 modules or is there a way to expose the default directly on the variable?

@michael-ciniawsky
Copy link
Member

No the loader still uses CJS internally so your exposed file becomes a harmony export atm. We could/should update this to use ESM instead, but needs triage

@michael-ciniawsky michael-ciniawsky added this to the 1.0.0 milestone Nov 16, 2017
@michael-ciniawsky michael-ciniawsky changed the title Default export available as module.default in ES6 modules [Refactor] Support exposing ESM without harmony export Nov 16, 2017
@michaelord
Copy link

Is there any work around for this issue? I've refactored code today and this issue has reared its head for me...

@patrick-mcdougle
Copy link

@michael-ciniawsky how does #85 look? Will this solve this issue?

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