Skip to content

Commit

Permalink
windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Aug 24, 2023
1 parent 6862f65 commit d6e58bb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/swc_ecma_loader/src/resolvers/tsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ where

let mut errors = vec![];
for target in to {
let replaced = target.replace('*', extra);
let mut replaced = target.replace('*', extra);

let _tracing = if cfg!(debug_assertions) {
Some(
Expand Down Expand Up @@ -227,6 +227,13 @@ where
Err(err) => err,
});

if cfg!(target_os = "windows") {
if replaced.starts_with("./") {
replaced = replaced[2..].to_string();
}
replaced = replaced.replace('/', "\\");
}

if to.len() == 1 {
info!(
"Using `{}` for `{}` because the length of the jsc.paths entry is \
Expand Down

0 comments on commit d6e58bb

Please sign in to comment.