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); }