-
Notifications
You must be signed in to change notification settings - Fork 45
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
Export both CJS and ESM for node #37
Conversation
add ESM compatible node version
"types": "index.d.ts", | ||
"browser": "browser.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please left the browser
field to keep backwards compatibility, it's not standard but some old tools could still be using it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this if that is what the package maintainer wants.
If they do, this PR has "allow edits by maintainers" enabled and should be an easy fix.
LGTM |
For reference, I understand why this is a difficult thing to get right - after forking and maintaining this change I've had numerous situation where this doesn't work. I don't expect this to get merged, and have since opted to ditch CJS support entirely in my own local instance. Feel free to re-open or use what makes sense if focus is turned back to this later. |
@monsterbitar is this still the case if you keep original If not would it be possible for this work to be released with that changed? |
yes, the issue is much deeper and there's just too many different variations and packaging setups that are close-but-not-quite-the-same across the board. Since browsers have supported ESM for quite some time now though, I'm simply looking forward to when we drop CJS altogether and remove the additional complexity. |
I have migrated to unws package, that's similar to this one but with full esm support. |
See #30 (comment) for details.