diff --git a/packages/vite/src/node/server/middlewares/indexHtml.ts b/packages/vite/src/node/server/middlewares/indexHtml.ts index 4ebc2a41e86bfe..d7422667794133 100644 --- a/packages/vite/src/node/server/middlewares/indexHtml.ts +++ b/packages/vite/src/node/server/middlewares/indexHtml.ts @@ -157,7 +157,7 @@ const processNodeUrl = ( if (server && shouldPreTransform(url, config)) { let preTransformUrl: string | undefined - if (url[0] === '/') { + if (url[0] === '/' && url[1] !== '/') { preTransformUrl = url } else if (url[0] === '.' || isBareRelative(url)) { preTransformUrl = path.posix.join(