diff options
author | await-ovo <13152410380@163.com> | 2023-08-02 07:20:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-01 23:20:08 +0000 |
commit | fec34d8069517be195193cd3578e7988d39fd0e1 (patch) | |
tree | 3fa2192d9bdd9a6d3e20b7fe32b726f86cde2e09 /ext/node/resolution.rs | |
parent | 21f1b2f62b1fac9089c214d9b862fce2359d30fd (diff) |
fix(ext/node): fix import json using npm specifier (#19723)
Diffstat (limited to 'ext/node/resolution.rs')
-rw-r--r-- | ext/node/resolution.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/node/resolution.rs b/ext/node/resolution.rs index bb25124bf..6e4637286 100644 --- a/ext/node/resolution.rs +++ b/ext/node/resolution.rs @@ -446,7 +446,7 @@ impl NodeResolver { url: ModuleSpecifier, ) -> Result<NodeResolution, AnyError> { let url_str = url.as_str().to_lowercase(); - if url_str.starts_with("http") { + if url_str.starts_with("http") || url_str.ends_with(".json") { Ok(NodeResolution::Esm(url)) } else if url_str.ends_with(".js") || url_str.ends_with(".d.ts") { let maybe_package_config = |