Merge pull request #1555 from mrzbigniew/fix/get-providence-config

fix(providence-analytics): Fixed issue with loading config on windows
This commit is contained in:
Thijs Louisse 2021-11-18 18:09:20 +01:00 committed by GitHub
commit 84cddd5b6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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(