Skip to content

Commit 42255cb

Browse files
authored
fix(ecmascript): displayname for styled_components (vercel/turborepo#4653)
### Description WEB-670 We need to supply filename for the display_name calculation.
1 parent a56e12a commit 42255cb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/turbopack-ecmascript/src/transform/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
collections::hash_map::DefaultHasher,
66
fmt::Debug,
77
hash::{Hash, Hasher},
8-
path::Path,
8+
path::{Path, PathBuf},
99
sync::Arc,
1010
};
1111

@@ -295,7 +295,7 @@ impl EcmascriptInputTransform {
295295
}
296296

297297
program.visit_mut_with(&mut styled_components::styled_components(
298-
FileName::Anon,
298+
FileName::Real(PathBuf::from(file_path.await?.path.clone())),
299299
file_name_hash,
300300
options,
301301
));

crates/turbopack-tests/tests/snapshot/styled_components/styled_components/output/a587c_tests_snapshot_styled_components_styled_components_input_index_b53fce.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)