We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44e70b3 commit a5572f6Copy full SHA for a5572f6
src/cli.js
@@ -2,6 +2,7 @@
2
import "tsx";
3
import { writeFile } from "node:fs/promises";
4
import { resolve } from "node:path";
5
+import { pathToFileURL } from "node:url";
6
import { parseArgs } from "node:util";
7
import { generateTheme } from "./generate.js";
8
@@ -32,8 +33,11 @@ try {
32
33
// Read the input theme file
34
const themePath = resolve(pwd, inputFile);
35
36
+ // Convert file path to URL for ESM import compatibility
37
+ const themeURL = pathToFileURL(themePath);
38
+
39
// Execute the theme file content to get the theme object
- const themeModule = await import(themePath);
40
+ const themeModule = await import(themeURL);
41
const theme =
42
themeModule.default?.default ??
43
themeModule.default ??
0 commit comments