Skip to content

Commit

Permalink
fix: path join
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Dec 24, 2024
1 parent 7080cef commit 44c32f1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/rspack_core/src/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,15 @@ impl Compiler {
) -> Result<()> {
if let Some(source) = asset.get_source() {
let (target_file, query) = filename.split_once('?').unwrap_or((filename, ""));
let file_path = output_path.join(target_file);
let file_path = {
let target_path = Utf8Path::new(target_file);
if target_path.is_absolute() {
output_path.join(target_path.strip_prefix("/").unwrap())
} else {
output_path.join(target_path)
}
};

self
.output_filesystem
.create_dir_all(
Expand Down

0 comments on commit 44c32f1

Please sign in to comment.