Closed queckezz closed 8 years ago
Wow I didn't know about those issues. Not sure why I even put default on that one anyway. There's too many ways to export, I really should just never use default. Ergh. I'll push up a new version with that fix.
Thanks for the long post explaining it too. Super helpful! :)
Can't wait for the fix :)
Just put out 2.0.0-rc5
, I just removed that default
export, but I'll check it out in more detail to make sure it's not messing with anything else.
On the top level you export all the necessary functions:
Sadly, officially this syntax isn't allowed in es6 modules. Exporting like that can't be statically analyzed. It was a bug that existed in babel@5 so that this works but they changed it in
babel@6
onwards. See here for some more context, specifically:When you look at dist/index.js#L1337-L1341 you can see it generates this:
Importing the above results in
undefined
:What you currently have to do:
Solution
To actually solve this you just need to remove
default
With this, it's now the opposite:
This costed me hours before. And that my friends, is why I don't like es6 modules (or im just missing something).