Skip to content

Commit 182cd54

Browse files
committed
fix: nodejs chunk_path
1 parent e43606a commit 182cd54

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

turbopack/crates/turbopack-nodejs/src/chunking_context.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,14 @@ impl ChunkingContext for NodeJsChunkingContext {
287287
extension: RcStr,
288288
) -> Result<Vc<FileSystemPath>> {
289289
let root_path = *self.chunk_root_path;
290-
let name = ident
291-
.output_name(*self.root_path, extension)
292-
.owned()
293-
.await?;
294-
Ok(root_path.join(name))
290+
let mut name = ident
291+
.output_name(*self.root_path, extension.clone())
292+
.await?
293+
.to_string();
294+
if !name.ends_with(extension.as_str()) {
295+
name.push_str(&extension);
296+
}
297+
Ok(root_path.join(name.into()))
295298
}
296299

297300
#[turbo_tasks::function]

0 commit comments

Comments
 (0)