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 #552

Merged
merged 1 commit 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
"types": "./lib/node/RemoteHttpInterceptor.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.

Should we have "default" here too? I wonder when does it fall through "default" 🤔 If it's nether require not import? So, in the current state, it will find no "node.default", and fallback to the "/node.default" on the export path level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think any tool that will apply an export condition like "node" will also apply "import" or "require". I would probably not pollute too much now until someone comes around the corner with an example where it's missing.

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.

This is fantastic! 🚀

@kettanaito kettanaito changed the title fix(package): give node condition high priority fix: give node export condition higher priority Apr 17, 2024
@kettanaito kettanaito merged commit 866f5bc into mswjs:main Apr 17, 2024
2 checks passed
@phryneas phryneas deleted the node-exports branch April 17, 2024 10:33
@kettanaito
Copy link
Member

Released: v0.28.1 🎉

This has been released in v0.28.1!

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