fix(kit): ignore @ alias without following slash (resolves #210)

This commit is contained in:
Pooya Parsa 2021-06-14 20:23:21 +02:00
parent c75c03e0bb
commit eee45396d1

View File

@ -77,6 +77,7 @@ function resolvePath (path: string, opts: ResolveOptions = {}) {
*/
export function resolveAlias (path: string, alias: ResolveOptions['alias']) {
for (const key in alias) {
if (key === '@') { continue } // Don't resolve @foo/bar
if (path.startsWith(key)) {
path = alias[key] + path.substr(key.length)
}