Skip to content

Commit 6dab576

Browse files
committed
fix: support windows
1 parent 8e7ea8e commit 6dab576

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.changeset/small-clouds-speak.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'phosphor-icons-tailwindcss': patch
3+
---
4+
5+
switch to `path/posix` implementation to support Windows

src/plugin.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { readFileSync, existsSync } from 'fs';
2+
import { join } from 'path/posix';
23

34
import { icons } from '@phosphor-icons/core';
45
import { resolve } from 'import-meta-resolve';
@@ -53,7 +54,11 @@ export default createPlugin.withOptions(
5354
if (ICON_SET.has(name) && VARIANTS.includes(weight)) {
5455
const fileUrl = new URL(
5556
resolve(
56-
`@phosphor-icons/core/assets/${weight}/${name}${weight === 'regular' ? '' : `-${weight}`}.svg`,
57+
join(
58+
'@phosphor-icons/core/assets',
59+
weight,
60+
`${name}${weight === 'regular' ? '' : `-${weight}`}.svg`,
61+
),
5762
import.meta.url,
5863
),
5964
);

tests/plugin.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path';
1+
import path from 'path/posix';
22

33
import { compile } from '@tailwindcss/node';
44
import postcss from 'postcss';

0 commit comments

Comments
 (0)