Fix extension config importing on Windows (#10242)

Fixes #10239
This commit is contained in:
Nicola Krumschmidt
2021-12-02 22:39:57 +01:00
committed by GitHub
parent e89a0a4e56
commit b500c32072

View File

@@ -9,7 +9,9 @@ const _import = new Function('url', 'return import(url)');
export default async function loadConfig(): Promise<Record<string, any>> {
for (const fileName of CONFIG_FILE_NAMES) {
if (await fse.pathExists(fileName)) {
const configFile = await _import(path.join(process.cwd(), fileName));
const configFile = await _import(
path.relative(__dirname, path.join(process.cwd(), fileName)).split(path.sep).join(path.posix.sep)
);
return configFile.default;
}