From 7ca2fe716564bc16d7eb370e1de6728aa68bf0a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 5 Jan 2023 18:34:28 +0900 Subject: [PATCH] fix --- crates/swc/src/config/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/swc/src/config/mod.rs b/crates/swc/src/config/mod.rs index 501388474a3a..71b020eef948 100644 --- a/crates/swc/src/config/mod.rs +++ b/crates/swc/src/config/mod.rs @@ -1309,9 +1309,11 @@ impl ModuleConfig { available_features: FeatureFlag, ) -> Box { let base = match base { - FileName::Real(path) if !paths.is_empty() && !path.is_absolute() => { - FileName::Real(std::env::current_dir().unwrap().join(path)) - } + FileName::Real(path) if !paths.is_empty() && !path.is_absolute() => FileName::Real( + std::env::current_dir() + .map(|v| v.join(path)) + .unwrap_or_else(|_| path.to_path_buf()), + ), _ => base.to_owned(), };