Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions turbopack/crates/turbopack-css/src/chunk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,20 @@ impl CssChunk {
}
}
}
// CSS cascade order is observable. For multi-item chunks, keep the ordinal in the nested
// asset key so the order-independent AssetIdent hash still distinguishes differently
// ordered chunks. Preserve the existing ident for single-item chunks.
let has_multiple_items = chunk_items.len() > 1;
let assets = chunk_items
.iter()
.map(async |chunk_item| {
.enumerate()
.map(async |(index, chunk_item)| {
Ok((
rcstr!("chunk item"),
if has_multiple_items {
format!("chunk item {index}").into()
} else {
rcstr!("chunk item")
},
chunk_item.content_ident().to_resolved().await?,
))
})
Expand Down
Loading