Skip to content

Commit a5572f6

Browse files
committed
fix: windows import
1 parent 44e70b3 commit a5572f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cli.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import "tsx";
33
import { writeFile } from "node:fs/promises";
44
import { resolve } from "node:path";
5+
import { pathToFileURL } from "node:url";
56
import { parseArgs } from "node:util";
67
import { generateTheme } from "./generate.js";
78

@@ -32,8 +33,11 @@ try {
3233
// Read the input theme file
3334
const themePath = resolve(pwd, inputFile);
3435

36+
// Convert file path to URL for ESM import compatibility
37+
const themeURL = pathToFileURL(themePath);
38+
3539
// Execute the theme file content to get the theme object
36-
const themeModule = await import(themePath);
40+
const themeModule = await import(themeURL);
3741
const theme =
3842
themeModule.default?.default ??
3943
themeModule.default ??

0 commit comments

Comments
 (0)