diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-07-25 21:40:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-25 21:40:10 -0400 |
commit | 790726559016c98655bd93c3f223f8ad5e480d41 (patch) | |
tree | e5beb55c0c0622a0b5deff7c1c666e781271a95a /ext/node_resolver/resolution.rs | |
parent | ef38aa9d9cec3cb43fff1cab7ada4a4689e861da (diff) |
fix(node): cjs pkg dynamically importing esm-only pkg fails (#24730)
Diffstat (limited to 'ext/node_resolver/resolution.rs')
-rw-r--r-- | ext/node_resolver/resolution.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/node_resolver/resolution.rs b/ext/node_resolver/resolution.rs index d7918c75c..25316c385 100644 --- a/ext/node_resolver/resolution.rs +++ b/ext/node_resolver/resolution.rs @@ -221,10 +221,8 @@ impl<TEnv: NodeResolverEnv> NodeResolver<TEnv> { specifier, referrer, referrer_kind, - match referrer_kind { - NodeModuleKind::Esm => DEFAULT_CONDITIONS, - NodeModuleKind::Cjs => REQUIRE_CONDITIONS, - }, + // even though the referrer may be CJS, if we're here that means we're doing ESM resolution + DEFAULT_CONDITIONS, mode, )?; |