Skip to content

Commit 108c9bc

Browse files
committed
chore: logic adjustment
1 parent 98c89c6 commit 108c9bc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/vite/src/node/server/middlewares/indexHtml.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ const devHtmlHook: IndexHtmlTransformHook = async (
191191
const trailingSlash = htmlPath.endsWith('/')
192192
if (!trailingSlash && getFsUtils(config).existsSync(filename)) {
193193
proxyModulePath = htmlPath
194-
proxyModuleUrl = joinUrlSegments(base, htmlPath)
194+
proxyModuleUrl = proxyModulePath
195195
} else {
196196
// There are users of vite.transformIndexHtml calling it with url '/'
197197
// for SSR integrations #7993, filename is root for this case
@@ -200,8 +200,9 @@ const devHtmlHook: IndexHtmlTransformHook = async (
200200
// and ids are properly handled
201201
const validPath = `${htmlPath}${trailingSlash ? 'index.html' : ''}`
202202
proxyModulePath = `\0${validPath}`
203-
proxyModuleUrl = joinUrlSegments(base, wrapId(proxyModulePath))
203+
proxyModuleUrl = wrapId(proxyModulePath)
204204
}
205+
proxyModuleUrl = joinUrlSegments(base, proxyModuleUrl)
205206

206207
const s = new MagicString(html)
207208
let inlineModuleIndex = -1

0 commit comments

Comments
 (0)