Skip to content

fix: print build paths relative to project root - #629

Draft
ElMassimo wants to merge 1 commit into
mainfrom
relative-paths
Draft

ElMassimo wants to merge 1 commit into
mainfrom
relative-paths

Conversation

@ElMassimo

Copy link
Copy Markdown
Owner

Description 📖

This pull request prints Vite build output paths relative to the Ruby project root, so Rails builds show public/vite/... instead of ../../public/vite/....

Background 📜

Vite Ruby uses the frontend source directory as Vite's root, while generated assets live under the Ruby project's public directory.

Vite 5–7 format their build report relative to Vite's nested root. The resulting ../../public/vite/... paths are technically correct, but they are confusing when the build runs from the Ruby project root. Vite 8's native reporter already prints the shorter project-relative form, while vite-plugin-ruby still supports Vite 5 and newer.

The Fix 🔨

Wrap the build logger and translate only the calculated output-directory prefix from Vite-root-relative to Ruby-project-relative. This changes the displayed path without changing build.outDir or where assets are written.

Existing custom loggers and log options are preserved. Unrelated messages and development-server logging are left unchanged.

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.

1 participant