Skip to content

Commit a42e9fa

Browse files
committed
fix: WIP attempt to fix path resolution for windows
1 parent 077bd47 commit a42e9fa

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/plugin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fs from 'fs';
2+
import path from 'path';
23

34
import { icons } from '@phosphor-icons/core';
45
import { resolve } from 'import-meta-resolve';
@@ -55,6 +56,8 @@ export default createPlugin.withOptions(
5556
`@phosphor-icons/core/assets/${weight}/${name}${weight === 'regular' ? '' : `-${weight}`}.svg`,
5657
import.meta.url,
5758
).replace('file://', '');
59+
console.log('dirname: ', import.meta.dirname);
60+
console.log('icon:', path.resolve(filepath));
5861

5962
if (fs.existsSync(filepath)) {
6063
const svgStr = fs.readFileSync(filepath, { encoding: 'base64' });

tests/plugin.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface Run {
1616
}
1717

1818
function tests(run: Run, version: number) {
19-
test('default', async function ({ expect }) {
19+
test.only('default', async function ({ expect }) {
2020
const result = await run([...COMMON_CANDIDATES, 'ph', 'ph-[info]']);
2121
await expect(result).toMatchFileSnapshot(
2222
path.resolve(import.meta.dirname, '__snapshots__', `v${version}/default.css`),

0 commit comments

Comments
 (0)