Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: normalize path before calling fileToBuiltUrl
  • Loading branch information
sapphi-red committed Oct 6, 2025
commit 9f4eef7c47e0795d4d21395460d8510fe0059abd
5 changes: 3 additions & 2 deletions packages/vite/src/node/plugins/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,11 @@ export async function urlToBuiltUrl(
if (checkPublicFile(url, topLevelConfig)) {
return publicFileToBuiltUrl(url, topLevelConfig)
}
const file =
const file = normalizePath(
url[0] === '/'
? path.join(topLevelConfig.root, url)
: path.join(path.dirname(importer), url)
: path.join(path.dirname(importer), url),
)
return fileToBuiltUrl(
pluginContext,
file,
Expand Down