Skip to content
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: enable esm export of package #26

Merged
merged 2 commits into from
Oct 6, 2022
Merged

Conversation

mattcosta7
Copy link
Contributor

@mattcosta7 mattcosta7 commented Sep 17, 2022

BREAKING CHANGE enable esm support

(accidentally closed that one)
superceedes #25

Expose cookies esm build.

Added tsup, and config similar to other msw related libraries

Once this was done, there were some bundle related issues, since set-cookie-parser is only released as commonjs.

In order to support this, we bundle that library by moving it into devDependencies instead of declaring it as a dependency. By default, tsup treats all 'dependencies' as external in an esm build, so this is not necessarily standard, but works to ensure that this library is treated as esm compatible.

BREAKING CHANGE enable esm support
@mattcosta7 mattcosta7 marked this pull request as ready for review September 17, 2022 04:36
Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mattcosta7
Copy link
Contributor Author

@kettanaito I pushed to this branch, to also use the .mjs extension instead of the separate esm folders, similar to the pr for headers-polyfill

Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, a fantastic follow-up! Thank you, @mattcosta7! 🎉

@kettanaito kettanaito merged commit 4f42790 into mswjs:main Oct 6, 2022
@kettanaito
Copy link
Member

Released: v1.0.0 🎉

This has been released in v1.0.0!

Make sure to always update to the latest version (npm i @mswjs/cookies@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants