mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(kit): don't ignore @
alias (#2737)
This commit is contained in:
parent
91032cdd64
commit
0ed2d4a00b
@ -85,9 +85,9 @@ function existsSyncSensitive (path: string, files?: string[]) {
|
|||||||
*/
|
*/
|
||||||
export function resolveAlias (path: string, alias: ResolveOptions['alias']) {
|
export function resolveAlias (path: string, alias: ResolveOptions['alias']) {
|
||||||
for (const key in alias) {
|
for (const key in alias) {
|
||||||
if (key === '@') { continue } // Don't resolve @foo/bar
|
if (key === '@' && !path.startsWith('@/')) { continue } // Don't resolve @foo/bar
|
||||||
if (path.startsWith(key)) {
|
if (path.startsWith(key)) {
|
||||||
path = alias[key] + path.substr(key.length)
|
path = alias[key] + path.slice(key.length)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return path
|
return path
|
||||||
|
Loading…
Reference in New Issue
Block a user