fix(javascript): honor module-sync package exports (#1361)

This commit is contained in:
Akshit Khokhani
2026-10-09 17:49:43 -05:00
committed by GitHub
parent a9f5dad5a8
commit d0e606930a
4 changed files with 58 additions and 2 deletions
@@ -640,7 +640,8 @@ const exportTargets = (
* Node selects an exports target by walking the declared keys in order and
* taking the first whose condition is active for the calling resolver.
* "default" is always active, and "node" plus "node-addons" are active for the
* built-in resolver that owns installed-package imports and requires.
* built-in resolver that owns installed-package imports and requires. The
* supported Node runtimes also activate "module-sync" for both loaders.
*/
const packageExportConditions = (
moduleKind: ResolveArtifactPathInput["moduleKind"],
@@ -648,6 +649,7 @@ const packageExportConditions = (
new Set([
"node",
"node-addons",
"module-sync",
...(moduleKind === undefined ? [] : [moduleKind]),
"default",
]);