-
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
assets:clean
incorrectly removes files created in the same build
#404
Comments
After further investigations, we found that Our temporary solution was to increase Sprocket seems to clean assets the same manner but seems to be able to generate all assets with an identical mtime |
Hi Kevin! Thanks for reporting. It seems like files in a Vite build have a different PRs are welcome! |
assets:clean
incorrectly removes files created in the same build
Vite plugins can create additional files, and some of them are never referenced in the manifest. As a result, cleaning files can only be done *safely* by doing it *before* building with Vite, otherwise it can potentially break an app. Deployment setups without a CDN would actually benefit from keeping previous builds. Otherwise, in SPA clients might request an asset or dynamic import chunk that was removed from the server upon deployment, remaining in a broken state until a full-page reload. Container-based deployments don't need `clean`, and they are one of the most common ways to deploy apps nowadays. Taking all of this into account, I've decided to remove this task from `vite_ruby`, preventing broken apps, and easing the maintenance burden of something that I've never used and most users don't need. Closes #438, #490, #404
Closed in 824b4ef. |
Description 📖
Some assets are missing on production after deployment. It happens totally randomly. A redeployment fixes the issue
Reproduction 🐞
deploy.rb
vite.config.ts
Vite Ruby Info
The text was updated successfully, but these errors were encountered: