From 7a6ceb9443bc202a72724eff8da3130fa5c4e417 Mon Sep 17 00:00:00 2001 From: uegi9quae1pee2qu Date: Sun, 25 Dec 2022 21:31:25 +0100 Subject: [PATCH] fix(swc): Remove import statement canonicalization --- crates/swc/src/config/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/swc/src/config/mod.rs b/crates/swc/src/config/mod.rs index f48ff94f6386..501388474a3a 100644 --- a/crates/swc/src/config/mod.rs +++ b/crates/swc/src/config/mod.rs @@ -1309,10 +1309,10 @@ impl ModuleConfig { available_features: FeatureFlag, ) -> Box { let base = match base { - FileName::Real(v) if !paths.is_empty() => { - FileName::Real(v.canonicalize().unwrap_or_else(|_| v.to_path_buf())) + FileName::Real(path) if !paths.is_empty() && !path.is_absolute() => { + FileName::Real(std::env::current_dir().unwrap().join(path)) } - _ => base.clone(), + _ => base.to_owned(), }; match config {