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

fix: give node export condition higher priority #2134

Merged
merged 3 commits into from Apr 17, 2024

Conversation

phryneas
Copy link
Contributor

in case of mixed environments that look for both
"node" and "browser" export conditions

in case of mixed environments that look for both
"node" and "browser" export conditions
@kettanaito kettanaito changed the title fix(package): give node condition high priority fix: give node export condition higher priority Apr 17, 2024
"types": "./lib/node/index.d.ts",
"node": {
Copy link
Member

Choose a reason for hiding this comment

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

Let's do the same for /native export too?

"types": "./lib/node/index.d.ts",
"node": {
Copy link
Member

Choose a reason for hiding this comment

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

Also, a reverse fix for /browser? Adding a browser field with a higher priority. Folks experience the reverse problem as well for msw/browser.

@@ -115,6 +115,15 @@ function validateExportConditions(pointer, conditions) {
return
}

if (typeof relativeExportPath === 'object') {
validateExportConditions(
Copy link
Member

Choose a reason for hiding this comment

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

Ouch! Thank you for spotting this. We didn't have any support for nested export conditions. This is nice ❇️

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.

Looks great. Thank you, @phryneas! 🚀

@kettanaito kettanaito merged commit f948d13 into mswjs:main Apr 17, 2024
11 checks passed
@kettanaito
Copy link
Member

Released: v2.2.14 🎉

This has been released in v2.2.14!

Make sure to always update to the latest version (npm i msw@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.

None yet

2 participants