Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: capistrano deployment docs correction for vite v5 #454

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/src/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,22 @@ While it was originally designed for sprockets, you can easily configure it for
set :assets_prefix, 'vite'
```

The [default value](https://github.com/capistrano/rails/blob/d86a8db16281f09d8cfff9ee791297134bce9801/lib/capistrano/tasks/assets.rake#L139) for `:assets_manifests` should already backup both:
When using Vite v4 and below, the [default value](https://github.com/capistrano/rails/blob/d86a8db16281f09d8cfff9ee791297134bce9801/lib/capistrano/tasks/assets.rake#L139)
for `:assets_manifests` should already backup both:
- `manifest.json`: generated by Vite for entrypoints
- `manifest-assets.json`: generated by _Vite Ruby_

However, when using Vite v5 and above, asset manifest files are output to a `public/vite/.vite` subdirectory
[by default](https://github.com/vitejs/vite/pull/14230). In order to inform Capistrano of this change, set the
`:assets_manifests` option.

```ruby
# config/deploy.rb

# Specifying a relative or absolute path is necessary
set :assets_manifests, ["public/#{fetch(:assets_prefix)}/.vite/manifest*.*"]
```

See <kbd>[capistrano-rails]</kbd> for more information about relevant settings
such as `keep_assets` and `assets_roles`.

Expand Down