fix(providance-analytics): Fixed issue with loading config on windows

This commit is contained in:
Zbigniew Jędraczka 2021-11-18 14:27:43 +01:00
parent 3bd6d3fd09
commit 4aad06a10c
2 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'providence-analytics': patch
---
Fixed dynamic import for providence config on windows

View file

@ -1,5 +1,6 @@
import pathLib from 'path';
import fs from 'fs';
import { pathToFileURL } from 'url';
/**
* @returns {Promise<object|null>}
@ -21,8 +22,8 @@ export async function getProvidenceConf() {
if (!confPathFound) {
return null;
}
const { default: providenceConf } = await import(confPathFound);
const { href: configPathUrl } = pathToFileURL(confPathFound);
const { default: providenceConf } = await import(configPathUrl);
if (!providenceConf) {
throw new Error(