Skip to content

fix: prefer require condition first in esm resolve mode - #117

Merged
pi0 merged 1 commit into
mainfrom
fix/prefer-require
Feb 17, 2023
Merged

pi0 merged 1 commit into
mainfrom
fix/prefer-require

Conversation

@pi0

@pi0 pi0 commented Feb 17, 2023

Copy link
Copy Markdown
Member

Jiti internally works with CJS and using MJS build is costly with non native transforms and can lead to issues.

When a package both cjs and esm exports (most of the unjs packages), jiti should prefer cjs first as is native. However if exports condition (key order matters) is { types, import, require } we first match import. Using two condition sets fixes the issue.

@pi0
pi0 merged commit e0156b8 into main Feb 17, 2023
@pi0
pi0 deleted the fix/prefer-require branch February 17, 2023 00:10
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.

1 participant