Skip to content

fix(html): emit HTML when root is symlinked#22685

Open
sapphi-red wants to merge 1 commit into
mainfrom
fix/html-handle-symlinked-root
Open

fix(html): emit HTML when root is symlinked#22685
sapphi-red wants to merge 1 commit into
mainfrom
fix/html-handle-symlinked-root

Conversation

@sapphi-red

Copy link
Copy Markdown
Member

When the root was a symlinked directory, Vite failed to emit the HTML, because it calculates the relative path from the symlinked root directory to the real path of the HTML file. When the relative path ends up with ../, this.emitFile errored.

This PR fixes that by try to calculate the relative path again from the realpath of the root. This isn't completely true because the symlink might be nested (e.g. foo/bar/baz.html and both foo and bar is a symlink), but this should cover most cases.

fixes #21955 that can be fixed on Vite side

@sapphi-red sapphi-red added p2-edge-case Bug, but has workaround or limited in scope (priority) feat: html labels Jun 15, 2026
daltino

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: html p2-edge-case Bug, but has workaround or limited in scope (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module ids escape Bazel's symlink sandbox

2 participants