Skip to content

Commit b971467

Browse files
committed
handle windows and unix path
1 parent 2a9b355 commit b971467

File tree

1 file changed

+3
-0
lines changed
  • packages/vite/src/node/plugins

1 file changed

+3
-0
lines changed

packages/vite/src/node/plugins/wasm.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ const wasmHelper = async (opts = {}, url: string) => {
3030
const fs = await import('node:fs/promises')
3131
if (url.startsWith('/@fs/')) {
3232
url = url.slice(5)
33+
if (!/^[A-Z]:/i.test(url)) {
34+
url = `/${url}`
35+
}
3336
} else if (url.startsWith('/')) {
3437
url = url.slice(1)
3538
}

0 commit comments

Comments
 (0)