mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
fix(vite): normalize full windows paths (#1650)
This commit is contained in:
parent
37f86a06c1
commit
a62351af4d
@ -55,6 +55,10 @@ async function transformRequest (opts: TransformOptions, id: string) {
|
||||
if (id && id.startsWith('/@fs/')) {
|
||||
// Absolute path
|
||||
id = id.slice('/@fs'.length)
|
||||
// On Windows, this may be `/C:/my/path` at this point, in which case we want to remove the `/`
|
||||
if (id.match(/^\/\w:/)) {
|
||||
id = id.slice(1)
|
||||
}
|
||||
} else if (!id.includes('entry') && id.startsWith('/')) {
|
||||
// Relative to the root directory
|
||||
id = '.' + id
|
||||
|
Loading…
Reference in New Issue
Block a user