Skip to content

Commit

Permalink
fix HTML entry file generation under Windows where different path sep…
Browse files Browse the repository at this point in the history
…aration characters exists than on POSIX filesystems (this fixes vitejs#15992)
  • Loading branch information
rse committed Apr 13, 2024
1 parent 102c2fd commit 0e31481
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,10 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
}

for (const [id, html] of processedHtml) {
const normalizedId = normalizePath(id)
const relativeUrlPath = path.posix.relative(
config.root,
normalizePath(id),
normalizedId,
)
const assetsBase = getBaseInHTML(relativeUrlPath, config)
const toOutputFilePath = (
Expand Down Expand Up @@ -813,7 +814,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
(chunk) =>
chunk.type === 'chunk' &&
chunk.isEntry &&
chunk.facadeModuleId === id,
chunk.facadeModuleId === normalizedId,
) as OutputChunk | undefined

let canInlineEntry = false
Expand Down

0 comments on commit 0e31481

Please sign in to comment.