Skip to content

Commit 73b6d24

Browse files
authored
fix: normalize path before calling fileToBuiltUrl (#20898)
1 parent b95fa2a commit 73b6d24

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/vite/src/node/plugins/asset.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,11 @@ export async function urlToBuiltUrl(
449449
if (checkPublicFile(url, topLevelConfig)) {
450450
return publicFileToBuiltUrl(url, topLevelConfig)
451451
}
452-
const file =
452+
const file = normalizePath(
453453
url[0] === '/'
454454
? path.join(topLevelConfig.root, url)
455-
: path.join(path.dirname(importer), url)
455+
: path.join(path.dirname(importer), url),
456+
)
456457
return fileToBuiltUrl(
457458
pluginContext,
458459
file,

0 commit comments

Comments
 (0)