diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-09 17:35:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-09 21:35:41 +0000 |
commit | 560ad0331bf99a2564f53201cd086ff902901bfe (patch) | |
tree | aa7b250366c62e7552793d954fabbfe6b47b80f4 /cli/resolver.rs | |
parent | aadcf3346c25ed9d880c2bfc43b62aa075ea6126 (diff) |
fix(node/byonm): do not accidentally resolve bare node built-ins (#25543)
This was accidentally enabled in byonm, but it requires the
`--unstable-bare-node-builtins` flag.
Closes #25358
Diffstat (limited to 'cli/resolver.rs')
-rw-r--r-- | cli/resolver.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cli/resolver.rs b/cli/resolver.rs index 5b657b895..07cb6931d 100644 --- a/cli/resolver.rs +++ b/cli/resolver.rs @@ -707,7 +707,14 @@ impl Resolver for CliGraphResolver { .resolve_if_for_npm_pkg(raw_specifier, referrer, to_node_mode(mode)) .map_err(ResolveError::Other)?; if let Some(res) = maybe_resolution { - return Ok(res.into_url()); + match res { + NodeResolution::Esm(url) | NodeResolution::CommonJs(url) => { + return Ok(url) + } + NodeResolution::BuiltIn(_) => { + // don't resolve bare specifiers for built-in modules via node resolution + } + } } } |