Closed JLuboff closed 3 years ago
How long do you think we should stick with that approach? Because it looks pretty funky haha
How long do you think we should stick with that approach? Because it looks pretty funky haha
I agree its funky....I'm not sure how to fix it without introducing a breaking change (change from export default
to export
or what not would break TS import method). Any ideas?
So one of the things I'ved noticed in the past when working with typescript projects is support for:
import MyLib from 'my-lib';
doesn't work without the allowSyntheticDefaultImports
being turned on in the tsconfig
. Often I see this being required in some of my projects that are using webpack on the back-end (which is weird) along with other tooling so it might be an exception.
Not sure if this is actually related or not, but its worth putting out there in-case we need to look more into it or it actually fixes it for someone.
So the thing with moving to this workaround its also technically a "breaking change" in that the docs will point to one way that may or not be fixed. I think with the reproduction code provided we can figure something out without breaking anything and without changing how it works. But we'll need to look into it a little more :thinking:
I'm updating my local code a bit, I might end up messaging you later if I run into problems. If anything I'll be able to run thru the gauntlet a little and see if I see anything
@bradtaniguchi has fixed the issue as opposed to my lame workaround 👍
@bradtaniguchi Mind doing a quick review? I updated the readme to access the default export when requiring in the JS example.