summaryrefslogtreecommitdiff
path: root/cli/args/config_file.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-07-14 18:10:42 -0400
committerGitHub <noreply@github.com>2023-07-14 18:10:42 -0400
commit306b51d7728a6e28461171d3332a0b3aa8545a6e (patch)
tree6a5b78c9fcd219ca9c236e5e22cdaba907158146 /cli/args/config_file.rs
parentb83dac3b14340d452ae9a83e5f4da0104407a220 (diff)
fix(vendor): do not panic vendoring with jsxImportSource and no jsx files (#19837)
Closes #19833
Diffstat (limited to 'cli/args/config_file.rs')
-rw-r--r--cli/args/config_file.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/args/config_file.rs b/cli/args/config_file.rs
index 76b522a41..1928d02fb 100644
--- a/cli/args/config_file.rs
+++ b/cli/args/config_file.rs
@@ -32,6 +32,16 @@ pub type MaybeImportsResult =
pub struct JsxImportSourceConfig {
pub default_specifier: Option<String>,
pub module: String,
+ pub base_url: ModuleSpecifier,
+}
+
+impl JsxImportSourceConfig {
+ pub fn maybe_specifier_text(&self) -> Option<String> {
+ self
+ .default_specifier
+ .as_ref()
+ .map(|default_specifier| format!("{}/{}", default_specifier, self.module))
+ }
}
/// The transpile options that are significant out of a user provided tsconfig
@@ -1035,6 +1045,7 @@ impl ConfigFile {
module.map(|module| JsxImportSourceConfig {
default_specifier: compiler_options.jsx_import_source,
module,
+ base_url: self.specifier.clone(),
})
}