Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Dec 31, 2024
1 parent e34c6af commit 00927c0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ impl SourceMapDevToolPlugin {
let chunk = file_to_chunk.get(&source_filename);
let filename = match &self.file_context {
Some(file_context) => Cow::Owned(
Path::new(file_context)
.relative(Path::new(&source_filename))
Path::new(&source_filename)
.relative(Path::new(file_context))
.to_string_lossy()
.to_string(),
),
Expand Down Expand Up @@ -454,10 +454,8 @@ impl SourceMapDevToolPlugin {
source_map_path.extend(Path::new(&source_map_filename).components());

#[allow(clippy::unwrap_used)]
file_path
.parent()
.unwrap()
.relative(&source_map_path)
source_map_path
.relative(file_path.parent().unwrap())
.to_string_lossy()
.to_string()
};
Expand Down

0 comments on commit 00927c0

Please sign in to comment.