Skip to content

Commit

Permalink
fix(es): Fix wasm (#6755)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jan 5, 2023
1 parent 3b034d5 commit b46815a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/swc/src/config/mod.rs
Expand Up @@ -1309,9 +1309,11 @@ impl ModuleConfig {
available_features: FeatureFlag,
) -> Box<dyn swc_ecma_visit::Fold + 'cmt> {
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(),
};

Expand Down

0 comments on commit b46815a

Please sign in to comment.