mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 05:35:33 +00:00
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.
This commit is contained in:
parent
6bb72a8086
commit
33c4d45328
12 changed files with 79 additions and 42 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue