Skip to content

Commit 721f94d

Browse files
authoredApr 18, 2024··
fix: add base to virtual html (#16442)
1 parent 8e54bbd commit 721f94d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

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

+2-1
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
@@ -202,6 +202,7 @@ const devHtmlHook: IndexHtmlTransformHook = async (
202202
proxyModulePath = `\0${validPath}`
203203
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)
Please sign in to comment.