unfetch
unfetch copied to clipboard
Fix Typescript export definitions
Typescript does not support .mjs files, so the module that ends up being imported is the commonJS version (dist/unfetch.js). Since that file does not contain a default export entry, using it in Typescript results in a runtime error: TypeError: isomorphic_unfetch_1.default is not a function
Fix by reverting to export =. To use in Typescript, use the form import * as fetch from "isomorphic-unfetch".
Yes, I have similar problem and this PR will solve it.
Thanks @vincentcr
I believe this should be addressed by #135, which drops the .mjs file extension and moves back to unfetch.module.js. Can anyone confirm?