Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(vite): normalize full windows paths (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 2, 2021
1 parent 37f86a0 commit a62351a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vite/src/dev-bundler.ts
Expand Up @@ -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
Expand Down

0 comments on commit a62351a

Please sign in to comment.