summaryrefslogtreecommitdiff
path: root/cli/args/mod.rs
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2022-08-24 19:36:05 +0200
committerGitHub <noreply@github.com>2022-08-24 19:36:05 +0200
commit33c4d45328166d103e99a8c243727eead626080c (patch)
tree70331a9964f8faf780942696c34aab867accf7bf /cli/args/mod.rs
parent6bb72a80863ac3913d32ea21aae32dd327ce6b71 (diff)
fix: resolve `jsxImportSource` relative to module (#15561)
Previously `jsxImportSource` was resolved relative to the config file during graph building, and relative to the emitted module during runtime. This is now fixed so that the JSX import source is resolved relative to the module both during graph building and at runtime.
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r--cli/args/mod.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs
index 85e44aca2..90fa5220b 100644
--- a/cli/args/mod.rs
+++ b/cli/args/mod.rs
@@ -34,6 +34,7 @@ use std::env;
use std::net::SocketAddr;
use std::path::PathBuf;
+use crate::args::config_file::JsxImportSourceConfig;
use crate::compat;
use crate::deno_dir::DenoDir;
use crate::emit::get_ts_config_for_emit;
@@ -210,12 +211,14 @@ impl CliOptions {
}
}
- /// Return the implied JSX import source module.
- pub fn to_maybe_jsx_import_source_module(&self) -> Option<String> {
+ /// Return the JSX import source configuration.
+ pub fn to_maybe_jsx_import_source_config(
+ &self,
+ ) -> Option<JsxImportSourceConfig> {
self
.maybe_config_file
.as_ref()
- .and_then(|c| c.to_maybe_jsx_import_source_module())
+ .and_then(|c| c.to_maybe_jsx_import_source_config())
}
/// Return any imports that should be brought into the scope of the module