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

Moved the "import" exports to be first #1023

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

reduckted
Copy link
Contributor

Summary

Moved the "import" conditional export to be defined first.

Background & Context

Conditional exports are processed in order:

Within the "exports" object, key order is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. The general rule is that conditions should be from most specific to least specific in object order.

https://nodejs.org/api/packages.html#conditional-exports

As far as I understand, this means the "imports" should be defined first so that it takes precedence over "require" or "default".

Thank you @ghiscoding for pointing this out in #1018 (comment).

I've also changed "require" to "default" so that it's the catch-all fallback.

Tasks

N/A

Dependencies

N/A

@cure53
Copy link
Owner

cure53 commented Nov 14, 2024

Many thanks! 🙇

@cure53 cure53 merged commit 6fea7af into cure53:main Nov 14, 2024
8 checks passed
@reduckted reduckted deleted the fix/export-order branch November 14, 2024 10:45
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