diff options
Diffstat (limited to 'cli/main.rs')
-rw-r--r-- | cli/main.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/cli/main.rs b/cli/main.rs index b6bc0c7ad..0e9a57382 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -397,7 +397,9 @@ async fn compile_command( .then(|| { let root_module = graph.as_ref().modules()[0]; match root_module.media_type { - MediaType::JavaScript => Some(Ok(root_module.source.to_string())), + MediaType::JavaScript if root_module.maybe_source.is_some() => { + Some(Ok(root_module.maybe_source.clone().unwrap().to_string())) + } _ => None, } }) @@ -467,7 +469,7 @@ async fn info_command( .map(|im| im.as_resolver()) }; let graph = deno_graph::create_graph( - vec![specifier], + vec![(specifier, deno_graph::ModuleKind::Esm)], false, None, &mut cache, @@ -547,7 +549,7 @@ async fn cache_command( for file in cache_flags.files { let specifier = resolve_url_or_path(&file)?; ps.prepare_module_load( - vec![specifier], + vec![(specifier, deno_graph::ModuleKind::Esm)], false, lib.clone(), Permissions::allow_all(), @@ -639,7 +641,7 @@ async fn create_graph_and_maybe_check( }; let graph = Arc::new( deno_graph::create_graph( - vec![root], + vec![(root, deno_graph::ModuleKind::Esm)], false, maybe_imports, &mut cache, @@ -707,7 +709,7 @@ fn bundle_module_graph( ps: &ProcState, flags: &Flags, ) -> Result<(String, Option<String>), AnyError> { - info!("{} {}", colors::green("Bundle"), graph.roots[0]); + info!("{} {}", colors::green("Bundle"), graph.roots[0].0); let (ts_config, maybe_ignored_options) = emit::get_ts_config( emit::ConfigType::Bundle, @@ -777,7 +779,7 @@ async fn bundle_command( .filter_map(|(_, r)| { r.as_ref() .ok() - .map(|(s, _)| s.to_file_path().ok()) + .map(|(s, _, _)| s.to_file_path().ok()) .flatten() }) .collect(); @@ -992,7 +994,7 @@ async fn run_with_watch(flags: Flags, script: String) -> Result<i32, AnyError> { .map(|im| im.as_resolver()) }; let graph = deno_graph::create_graph( - vec![main_module.clone()], + vec![(main_module.clone(), deno_graph::ModuleKind::Esm)], false, maybe_imports, &mut cache, @@ -1016,7 +1018,7 @@ async fn run_with_watch(flags: Flags, script: String) -> Result<i32, AnyError> { .filter_map(|(_, r)| { r.as_ref() .ok() - .map(|(s, _)| s.to_file_path().ok()) + .map(|(s, _, _)| s.to_file_path().ok()) .flatten() }) .collect(); |