Skip to content

Commit

Permalink
fix: transform relative path uncorrectly in /index.html #10989
Browse files Browse the repository at this point in the history
  • Loading branch information
candy-Tong committed Nov 19, 2022
1 parent 8158ece commit 3c64bd3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/vite/src/node/server/middlewares/indexHtml.ts
Expand Up @@ -102,12 +102,7 @@ const processNodeUrl = (
originalUrl !== '/' &&
htmlPath === '/index.html'
) {
const replacer = (url: string) =>
path.posix.join(
devBase,
path.posix.relative(originalUrl, devBase),
url.slice(1)
)
const replacer = (url: string) => path.posix.join(devBase, url.slice(1))

// #3230 if some request url (localhost:3000/a/b) return to fallback html, the relative assets
// path will add `/a/` prefix, it will caused 404.
Expand Down

0 comments on commit 3c64bd3

Please sign in to comment.