unjs / pathe

🛣️ Drop-in replacement of the Node.js's path module module that ensures paths are normalized

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot resolve alias with `/`

huang-julien opened this issue · comments

Environment

node: 20
pathe: 1.1.1

Reproduction

https://stackblitz.com/edit/stackblitz-starters-cvjzuh

unjs/nitro#2030

using JITI, it cannot resolve alias from the nitroOptions

Describe the bug

things like @/ or ~~/ cannot be correctly resolve with resolveAlias

resolveAlias('@/world', { '@/': 'hello' }) will return @/world instead of hello/world

Additional context

No response

Logs

No response