diff --git a/src/utils.ts b/src/utils.ts index f58e6cc..2305ecd 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,5 @@ -import { normalize, join } from './path' +import { join } from './path' +import { normalizeWindowsPath } from './_internal' const pathSeparators = ['/', '\\', undefined] @@ -27,7 +28,7 @@ export function normalizeAliases (_aliases: Record) { } export function resolveAlias (path: string, aliases: Record) { - const _path = normalize(path) + const _path = normalizeWindowsPath(path) aliases = normalizeAliases(aliases) for (const alias in aliases) { if (_path.startsWith(alias)) { diff --git a/test/utils.spec.ts b/test/utils.spec.ts index 8446bb8..d97fd23 100644 --- a/test/utils.spec.ts +++ b/test/utils.spec.ts @@ -32,6 +32,7 @@ describe('alias', () => { } it('unchanged', () => { expect(resolveAlias('foo/bar.js', aliases)).toBe('foo/bar.js') + expect(resolveAlias('./bar.js', aliases)).toBe('./bar.js') }) }) })