Skip to content

Commit 400ece7

Browse files
authored
Normalize virtual CSS file paths for Windows (#126)
1 parent 8f4f727 commit 400ece7

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.changeset/five-items-nail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vanilla-extract/integration': patch
3+
---
4+
5+
Normalize virtual CSS file paths for Windows

packages/integration/src/processVanillaFile.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import path from 'path';
2+
13
import { FileScope, Adapter } from '@vanilla-extract/css';
24
import { setAdapter } from '@vanilla-extract/css/adapter';
35
import { transformCss } from '@vanilla-extract/css/transformCss';
@@ -89,11 +91,13 @@ export function processVanillaFile({
8991
}).join('\n');
9092

9193
const base64Source = Buffer.from(css, 'utf-8').toString('base64');
92-
const fileName = `${
93-
filescope.packageName
94-
? `${filescope.packageName}/${filescope.filePath}`
95-
: filescope.filePath
96-
}.vanilla.css`;
94+
const fileName = path.normalize(
95+
`${
96+
filescope.packageName
97+
? `${filescope.packageName}/${filescope.filePath}`
98+
: filescope.filePath
99+
}.vanilla.css`,
100+
);
97101

98102
const virtualCssFilePath = serializeVirtualCssPath
99103
? serializeVirtualCssPath({ fileName, base64Source })

0 commit comments

Comments
 (0)