-
Notifications
You must be signed in to change notification settings - Fork 122
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
clean command not detecting versions properly #438
Comments
Hi Philippe, thanks for reporting! Fixing this will likely require grouping files by modified time using a certain range (maybe 5 minutes is a reasonable default). |
This is a duplicate of #404, right? |
This was broken in ElMassimo@8a581c1 with no explanation of why it was being removed.
Fix proposed in #477 which mirrors the behaviour of vite_ruby before a recent tangentially related bugfix, as well as Webpacker. |
This PR won't fix the issue described here. The issue still remains that Vite Ruby relies on common |
Ok, but it will fix guaranteeing you retain at least the most recent version. |
Description 📖
vite_ruby
uses themtime
as a reference to detect different versions of the app: https://github.com/ElMassimo/vite_ruby/blob/main/vite_ruby/lib/vite_ruby/commands.rb#L148 That being said, a single Vite build can generate files with more than onemtime
. For example,vite-plugin-rails
usesrollup-plugin-gzip
at the end of the build which will write many files with differentmtime
s.This causes files to delete unexpectedly when running
bin/vite clean
. It's possible this bug is hard to reproduce with a small project as all written files may end up having the samemtime
.Reproduction 🐞
Vite Ruby Info
bin/rake vite:build
on a big project with no currently built assets.bin/rake vite:clean[1,0]
Result: files will be deleted while there is only a single version of the built assets.
The text was updated successfully, but these errors were encountered: