diff --git a/packages/vite/src/node/server/middlewares/static.ts b/packages/vite/src/node/server/middlewares/static.ts index fe0ebaadd435d1..adf52bb9ebb593 100644 --- a/packages/vite/src/node/server/middlewares/static.ts +++ b/packages/vite/src/node/server/middlewares/static.ts @@ -71,6 +71,8 @@ export function serveRawFsMiddleware(): Connect.NextHandleFunction { if (url.startsWith(FS_PREFIX)) { url = url.slice(FS_PREFIX.length) if (isWin) url = url.replace(/^[A-Z]:/i, '') + + req.url = url serveFromRoot(req, res, next) } else { next()