diff options
Diffstat (limited to 'cli/args')
-rw-r--r-- | cli/args/config_file.rs | 8 | ||||
-rw-r--r-- | cli/args/mod.rs | 10 |
2 files changed, 6 insertions, 12 deletions
diff --git a/cli/args/config_file.rs b/cli/args/config_file.rs index 7bf568d55..0d84de2e4 100644 --- a/cli/args/config_file.rs +++ b/cli/args/config_file.rs @@ -26,7 +26,7 @@ use std::path::Path; use std::path::PathBuf; pub type MaybeImportsResult = - Result<Option<Vec<(ModuleSpecifier, Vec<String>)>>, AnyError>; + Result<Vec<deno_graph::ReferrerImports>, AnyError>; #[derive(Hash)] pub struct JsxImportSourceConfig { @@ -765,7 +765,7 @@ impl ConfigFile { if let Some(value) = self.json.compiler_options.as_ref() { value } else { - return Ok(None); + return Ok(Vec::new()); }; let compiler_options: CompilerOptions = serde_json::from_value(compiler_options_value.clone())?; @@ -774,9 +774,9 @@ impl ConfigFile { } if !imports.is_empty() { let referrer = self.specifier.clone(); - Ok(Some(vec![(referrer, imports)])) + Ok(vec![deno_graph::ReferrerImports { referrer, imports }]) } else { - Ok(None) + Ok(Vec::new()) } } diff --git a/cli/args/mod.rs b/cli/args/mod.rs index d75f25d52..95dfa4535 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -690,16 +690,10 @@ impl CliOptions { /// Return any imports that should be brought into the scope of the module /// graph. pub fn to_maybe_imports(&self) -> MaybeImportsResult { - let mut imports = Vec::new(); if let Some(config_file) = &self.maybe_config_file { - if let Some(config_imports) = config_file.to_maybe_imports()? { - imports.extend(config_imports); - } - } - if imports.is_empty() { - Ok(None) + config_file.to_maybe_imports() } else { - Ok(Some(imports)) + Ok(Vec::new()) } } |