-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Avoid having to use esModuleInterop #43
Comments
This module mirrors You should be using a bundler, not |
And with this change it will still acting the same, with the difference that it will comply with ES6 modules as well. I tried it in a project without typescript
So yes, a bundler (webpack) is used, but in this project (big company one, hard to change configs) is not working properly. |
Can't use |
One workaround might be |
ES6 modules are supposed to be an object, however this package exports a function by default.
To make it work in TypeScript it requires this option set to
true
, which means extra code in the build... and would be nice not requiring it.now:
after:
Since this would be a breaking change, I would suggest applying this fix in a way that the old version is also supported -which requires a bit of dirty code- and then apply the clean version in a major version up release :)
next version (let's say a major version up) could just export the function like this:
With this migration we are achieving two things:
esModuleInterop
wouldn't be required anymoreThe text was updated successfully, but these errors were encountered: