fix(es): Remove import statement canonicalization (#6716)

This commit is contained in:
realtimetodie 2022-12-27 01:59:54 +01:00 committed by GitHub
parent 641e03c997
commit b451fa9e88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1309,10 +1309,10 @@ impl ModuleConfig {
available_features: FeatureFlag,
) -> Box<dyn swc_ecma_visit::Fold + 'cmt> {
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 {