Skip to content

Commit 19e5ae6

Browse files
authored
[unplugin] Fix the path check for Windows (#136)
1 parent 344d4ea commit 19e5ae6

File tree

1 file changed

+2
-0
lines changed
  • packages/pigment-css-unplugin/src

1 file changed

+2
-0
lines changed

packages/pigment-css-unplugin/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
335335
...(isNext
336336
? {
337337
transformInclude(id) {
338+
id = id.replace(/\\/g, '/');
338339
return (
339340
// this file should exist in the package
340341
id.endsWith(`${process.env.RUNTIME_PACKAGE_NAME}/styles.css`) ||
@@ -344,6 +345,7 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
344345
);
345346
},
346347
transform(_code, id) {
348+
id = id.replace(/\\/g, '/');
347349
if (id.endsWith('styles.css')) {
348350
return theme ? generateTokenCss(theme) : _code;
349351
}

0 commit comments

Comments
 (0)