Closed
Description
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
{
"./data/*": "./data/*.json",
"./": "./"
}
{
"./": "./",
"./data/*": "./data/*.json"
}
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.
Metadata
Metadata
Assignees
Labels
No labels