We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c1c151 commit 7830879Copy full SHA for 7830879
.changeset/funny-wasps-pay.md
@@ -0,0 +1,5 @@
1
+---
2
+"@swc/plugin-emotion": patch
3
4
+
5
+Fix filename handling for Windows
packages/emotion/transform/src/lib.rs
@@ -216,6 +216,11 @@ impl<C: Comments> EmotionTransformer<C> {
216
filename: path
217
.file_stem()
218
.and_then(|filename| filename.to_str())
219
+ .and_then(|s| {
220
+ s.rfind('\\')
221
+ .map(|pos| &s[pos + 1..]) // if backslashes are found, take the last part
222
+ .or(Some(s)) // otherwise use the whole path
223
+ })
224
.map(|s| s.to_owned()),
225
cm,
226
comments,
0 commit comments