You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following two exports objects are equivalent for Node, but resolve.exports only works correctly for the first. This can be verified by swapping lines 401 and 402 in test/resolve.js
Looking at the ESM resolution algorithm in node's documentation (PACKAGE_IMPORTS_EXPORTS_RESOLVEhere), node sorts the keys by key length before looking for a match.
The text was updated successfully, but these errors were encountered:
Rather than actually sorting as mentioned in the node docs I've chosen to loop through the entire object, as sorting would get slower for larger export objects.
The following two exports objects are equivalent for Node, but
resolve.exports
only works correctly for the first. This can be verified by swapping lines 401 and 402 intest/resolve.js
Looking at the ESM resolution algorithm in node's documentation (
PACKAGE_IMPORTS_EXPORTS_RESOLVE
here), node sorts the keys by key length before looking for a match.The text was updated successfully, but these errors were encountered: