summaryrefslogtreecommitdiff
path: root/cli/module_loader.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-08-24 14:54:20 +0200
committerGitHub <noreply@github.com>2022-08-24 14:54:20 +0200
commit5268fa0e0f34571f0fc615eb665747863aca311e (patch)
tree3c23531d8484e4821662bc822634eabb9862dd57 /cli/module_loader.rs
parentf3bde1d53b4710fb526286e27af29a55f5da18c7 (diff)
fix(unstable): various resolution bugs for npm: specifiers (#15546)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'cli/module_loader.rs')
-rw-r--r--cli/module_loader.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/module_loader.rs b/cli/module_loader.rs
index 05dd5bd73..5d567f8c5 100644
--- a/cli/module_loader.rs
+++ b/cli/module_loader.rs
@@ -63,6 +63,13 @@ impl CliModuleLoader {
&self,
specifier: &ModuleSpecifier,
) -> Result<ModuleCodeSource, AnyError> {
+ if specifier.as_str() == "node:module" {
+ return Ok(ModuleCodeSource {
+ code: deno_runtime::deno_node::MODULE_ES_SHIM.to_string(),
+ found_url: specifier.to_owned(),
+ media_type: MediaType::JavaScript,
+ });
+ }
let graph_data = self.ps.graph_data.read();
let found_url = graph_data.follow_redirect(specifier);
match graph_data.get(&found_url) {