From 1aec0536d9d23ec57a2f1729ab7656ca1c30cfe2 Mon Sep 17 00:00:00 2001 From: Yimura Date: Sun, 28 Nov 2021 23:43:03 +0100 Subject: [PATCH] fix(Loader): Fix for Windows relative path parsing --- util/loader.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/loader.js b/util/loader.js index 0836611..e0f3658 100644 --- a/util/loader.js +++ b/util/loader.js @@ -1,7 +1,8 @@ -import { resolve as resolvePath } from 'path' +import { resolve as resolvePath, join as joinPath } from 'path' export async function resolve(specifier, context, defaultResolver) { - specifier = specifier.replace(/^@\//, resolvePath('.') + '/'); + if (specifier.startsWith('@/')) + specifier = joinPath('file://', resolvePath('.'), specifier.replace(/^@\//, '')); return defaultResolver(specifier, context); }