summaryrefslogtreecommitdiff
path: root/cli/config_file.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-06-14 10:05:37 -0400
committerGitHub <noreply@github.com>2022-06-14 10:05:37 -0400
commit443041c23e2e02ea59d69e1f2093c67ddfd818fd (patch)
tree06f449773377ec655982d00cdaf4bbd60857973f /cli/config_file.rs
parentfc3a966a2d0be8fc76c384603bf18b55e0bbcf14 (diff)
feat(vendor): support using an existing import map (#14836)
Diffstat (limited to 'cli/config_file.rs')
-rw-r--r--cli/config_file.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/config_file.rs b/cli/config_file.rs
index 3644bb7c1..4b2596ba2 100644
--- a/cli/config_file.rs
+++ b/cli/config_file.rs
@@ -11,6 +11,7 @@ use deno_core::anyhow::bail;
use deno_core::anyhow::Context;
use deno_core::error::custom_error;
use deno_core::error::AnyError;
+use deno_core::normalize_path;
use deno_core::serde::Deserialize;
use deno_core::serde::Serialize;
use deno_core::serde::Serializer;
@@ -262,12 +263,12 @@ pub fn resolve_import_map_specifier(
// file into a file path if possible and join the import map path to
// the file path.
if let Ok(config_file_path) = config_file.specifier.to_file_path() {
- let import_map_file_path = config_file_path
+ let import_map_file_path = normalize_path(config_file_path
.parent()
.ok_or_else(|| {
anyhow!("Bad config file specifier: {}", config_file.specifier)
})?
- .join(&import_map_path);
+ .join(&import_map_path));
ModuleSpecifier::from_file_path(import_map_file_path).unwrap()
// otherwise if the config file is remote, we have no choice but to
// use "import resolution" with the config file as the base.