From 33c4d45328166d103e99a8c243727eead626080c Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 24 Aug 2022 19:36:05 +0200 Subject: 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. --- cli/lsp/documents.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/lsp/documents.rs') diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index 18c3710fb..0fa85c095 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -998,8 +998,8 @@ impl Documents { // TODO(@kitsonk) update resolved dependencies? self.maybe_import_map = maybe_import_map.map(ImportMapResolver::new); self.maybe_jsx_resolver = maybe_config_file.and_then(|cf| { - cf.to_maybe_jsx_import_source_module() - .map(|im| JsxResolver::new(im, self.maybe_import_map.clone())) + cf.to_maybe_jsx_import_source_config() + .map(|cfg| JsxResolver::new(cfg, self.maybe_import_map.clone())) }); self.imports = Arc::new( if let Some(Ok(Some(imports))) = -- cgit v1.2.3