Skip to content

fix: preserve logical HTML entry paths for symlinks (fix #23585) - #23589

Open
charan-rathore wants to merge 4 commits into
vitejs:mainfrom
charan-rathore:fix/symlinked-html-entry-output
Open

charan-rathore wants to merge 4 commits into
vitejs:mainfrom
charan-rathore:fix/symlinked-html-entry-output

Conversation

@charan-rathore

Copy link
Copy Markdown

When an HTML entry inside the project root is a symlink to a file outside it, the build resolves to the real file's location and computes the emitted output path from there. That path points outside the build directory, so the build fails. This change records each configured HTML input's logical path at build start and uses it for the emitted filename and asset URLs, so the output lands where the configured entry says it should. Adds regression tests for symlinked index.html, nested and duplicate-basename entries, relative inputs, and a symlinked project root. Fixes #23585.

Reproduction: https://github.com/u9g/vite-symlinked-entry-repro

Patch drafted with AI assistance (Grok 4.7); reviewed, tested and verified locally - build, full build test suite (72/72), typecheck, lint and formatting all pass.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails when the HTML entry is a symlink to a file outside root (Bazel sandbox)

3 participants