Closed pelotom closed 8 years ago
@bradleyayers how does our build work with babel 5 modules? Do we need to do anything once this uses babel6?
In our project TypeScript targets ES6, and webpack does the ES6→ES5 conversion and takes responsibility for the fuzzy default imports. Nothing will change for us.
In the current build of the library, at the top of the file we have
but then at the end we have
The latter wipes out the former, eliminating the default export. It probably usually goes unnoticed because with Babel, a default import falls back to importing the entire module, so
becomes the same as
Unfortunately TypeScript is less forgiving, requiring you to get the default import vs
import *
right, and as a result this package doesn't work out of the box with typescript. It also seems impossible to assign a functional type to animport *
, which is what we need to do in this case. So, long story short, I think the solution is to upgrade Babel so the default export works as expected.