Skip to content

Commit

Permalink
fix: support file:// import protocal
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 12, 2022
1 parent 8936fa1 commit a241860
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite-node/src/utils.ts
Expand Up @@ -16,7 +16,8 @@ export function normalizeId(id: string, base?: string): string {
.replace(/^\/@id\/__x00__/, '\0') // virtual modules start with `\0`
.replace(/^\/@id\//, '')
.replace(/^__vite-browser-external:/, '')
.replace(/^node:/, '')
.replace(/^(node|file):/, '')
.replace(/^\/+/, '/') // remove duplicate leading slashes
.replace(/[?&]v=\w+/, '?') // remove ?v= query
.replace(/\?$/, '') // remove end query mark
}
Expand Down

0 comments on commit a241860

Please sign in to comment.