Skip to content

Commit

Permalink
chore: logic adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
XiSenao committed Apr 18, 2024
1 parent 98c89c6 commit 108c9bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/server/middlewares/indexHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const devHtmlHook: IndexHtmlTransformHook = async (
const trailingSlash = htmlPath.endsWith('/')
if (!trailingSlash && getFsUtils(config).existsSync(filename)) {
proxyModulePath = htmlPath
proxyModuleUrl = joinUrlSegments(base, htmlPath)
proxyModuleUrl = proxyModulePath
} else {
// There are users of vite.transformIndexHtml calling it with url '/'
// for SSR integrations #7993, filename is root for this case
Expand All @@ -200,8 +200,9 @@ const devHtmlHook: IndexHtmlTransformHook = async (
// and ids are properly handled
const validPath = `${htmlPath}${trailingSlash ? 'index.html' : ''}`
proxyModulePath = `\0${validPath}`
proxyModuleUrl = joinUrlSegments(base, wrapId(proxyModulePath))
proxyModuleUrl = wrapId(proxyModulePath)
}
proxyModuleUrl = joinUrlSegments(base, proxyModuleUrl)

const s = new MagicString(html)
let inlineModuleIndex = -1
Expand Down

0 comments on commit 108c9bc

Please sign in to comment.