summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs22
1 files changed, 16 insertions, 6 deletions
diff --git a/cli/main.rs b/cli/main.rs
index f8c5d69df..091c33b13 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -803,9 +803,14 @@ async fn bundle_command(
})
.collect();
- if let Some(import_map) = ps.flags.import_map_path.as_ref() {
- paths_to_watch
- .push(fs_util::resolve_from_cwd(std::path::Path::new(import_map))?);
+ if let Ok(Some(import_map_path)) =
+ config_file::resolve_import_map_specifier(
+ ps.flags.import_map_path.as_deref(),
+ ps.maybe_config_file.as_ref(),
+ )
+ .map(|ms| ms.map(|ref s| s.to_file_path().ok()).flatten())
+ {
+ paths_to_watch.push(import_map_path);
}
Ok((paths_to_watch, graph, ps))
@@ -1047,9 +1052,14 @@ async fn run_with_watch(flags: Flags, script: String) -> Result<i32, AnyError> {
paths_to_watch.extend(watch_paths);
}
- if let Some(import_map) = ps.flags.import_map_path.as_ref() {
- paths_to_watch
- .push(fs_util::resolve_from_cwd(std::path::Path::new(import_map))?);
+ if let Ok(Some(import_map_path)) =
+ config_file::resolve_import_map_specifier(
+ ps.flags.import_map_path.as_deref(),
+ ps.maybe_config_file.as_ref(),
+ )
+ .map(|ms| ms.map(|ref s| s.to_file_path().ok()).flatten())
+ {
+ paths_to_watch.push(import_map_path);
}
Ok((paths_to_watch, main_module, ps))