summaryrefslogtreecommitdiff
path: root/cli/cache/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/cache/mod.rs')
-rw-r--r--cli/cache/mod.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs
index e1c417c9f..ca03ca940 100644
--- a/cli/cache/mod.rs
+++ b/cli/cache/mod.rs
@@ -114,18 +114,14 @@ impl Loader for FetchCacher {
let specifier =
if let Some(module_name) = specifier.as_str().strip_prefix("node:") {
- if module_name == "module" {
- // the source code for "node:module" is built-in rather than
- // being from deno_std like the other modules
- return Box::pin(futures::future::ready(Ok(Some(
- deno_graph::source::LoadResponse::External {
- specifier: specifier.clone(),
- },
- ))));
- }
-
+ // Built-in Node modules are embedded in the Deno binary (in V8 snapshot)
+ // so we don't want them to be loaded by the "deno graph".
match crate::node::resolve_builtin_node_module(module_name) {
- Ok(specifier) => specifier,
+ Ok(specifier) => {
+ return Box::pin(futures::future::ready(Ok(Some(
+ deno_graph::source::LoadResponse::External { specifier },
+ ))))
+ }
Err(err) => return Box::pin(futures::future::ready(Err(err))),
}
} else {