From 4acf85e52713b9996543cb86c10357d8a545a343 Mon Sep 17 00:00:00 2001 From: michael42 Date: Tue, 31 May 2022 04:13:18 +0200 Subject: [PATCH] fix: Convert paths to fix ERR_UNSUPPORTED_ESM_URL_SCHEME errors on Windows (#238) --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index d7bc94c..a7d1670 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,7 @@ 'use strict' const resolve = require('path').resolve +const url = require('url') const config = require('lilconfig') const yaml = require('yaml') @@ -67,7 +68,7 @@ const createContext = (ctx) => { } const importDefault = async filepath => { - const module = await import(filepath) + const module = await import(url.pathToFileURL(filepath).href) return module.default }