Skip to content

Commit b262f10

Browse files
committed
fix importing js configs on windows
1 parent e80381b commit b262f10

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/utils/lib/config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ export async function loadConfigFromFile(configPath) {
119119
return config;
120120
} else {
121121
// otherwise, parse as js
122-
return (await import(configPath)).default;
122+
123+
// need to use fileURLToPath here for windows support (prefixes with file://)
124+
const fileUrl = url.pathToFileURL(configPath);
125+
return (await import(fileUrl.toString())).default;
123126
}
124127
} catch (err) {
125128
throw new Error(`Unable to load config file '${chalk.white(configPath)}'`, { cause: err });

0 commit comments

Comments
 (0)