-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: support esm #38
Conversation
"types": "./lib/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./lib/index.d.ts", |
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.
we might eventually add a browser
export as well here, that just re-exports from globalThis
instead of always using the polyfill, since browsers should all support Headers
now, but that's outside the scope of this work
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.
@mattcosta7, this may be a good idea indeed for the future improvements.
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.
Awesome! Thank you, @mattcosta7! 🎉
Released: v3.1.0 🎉This has been released in v3.1.0! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
There are a couple of regressions coming out from this (see mswjs/interceptors#285). I'm on fixing those. |
Ah sorry, I should have labeled this a breaking to avoid semver issues! |
No worries. I've patched things everywhere, it should work properly now. |
- Inspired by mswjs/headers-polyfill#38 - Solves failing browser ESM compatibility introduced by https://github.com/mswjs/interceptors/releases/tag/v0.24.1
Build an esm version of headers-polyfill and expose via exports
Using tsup, similar to other msw tools to output an esm version of this library, and updating the exports field to support that output (as well as a module field and a secondary esm pacakge.json for completeness)