Skip to content

Commit df2a783

Browse files
authored
Fix ESM import path for Windows compatibility in resolveTailwindConfig (#123)
* Used `pathToFileURL` to convert `CONFIGPATH` to a valid `file://` URL before importing. * This modification ensures the dynamic import function works as expected on Windows by conforming to the required URL scheme. * Resolves #122
1 parent 13a6e20 commit df2a783

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/resolveTailwindConfig.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ function parseConfig(data) {
2121
async function resolveTailwindConfig() {
2222
const fs = await import('fs');
2323
const { default: resolveConfig } = await import('tailwindcss/resolveConfig.js')
24-
const { default: config } = await import(process.env.CONFIGPATH)
24+
25+
const { pathToFileURL } = await import('url');
26+
const configPath = pathToFileURL(process.env.CONFIGPATH).href;
27+
const { default: config } = await import(configPath)
2528

2629
const fullConfig = resolveConfig(config);
2730

0 commit comments

Comments
 (0)