Skip to content

Commit

Permalink
fix: chunk file name should be url-friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Jul 22, 2024
1 parent 37502fc commit 9c05d7d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/mako/src/generate/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ impl Chunk {
.components()
.filter(|c| !matches!(c, Component::RootDir | Component::CurDir))
.map(|c| match c {
Component::ParentDir => "@".to_string(),
Component::Prefix(_) => "@".to_string(),
Component::ParentDir => "_pd_".to_string(),
Component::Prefix(_) => "_ps_".to_string(),
Component::RootDir => "".to_string(),
Component::CurDir => "".to_string(),
Component::Normal(seg) => seg.to_string_lossy().replace(['.', '?'], "_"),
Component::Normal(seg) => {
seg.to_string_lossy().replace(['.', '?', '@'], "_")
}
})
.collect::<Vec<String>>()
.join("_");
Expand Down

0 comments on commit 9c05d7d

Please sign in to comment.