Open chemic opened 4 years ago
I can think of two solutions:
:assets_manifests
setting. We could add some conditional logic that if :assets_manifests
is empty or nil
then we skip the backup_manifest
task.require "capistrano/rails/assets"
as you do today. If you are using webpacker only, then you would use require "capistrano/rails/webpacker"
instead.I kind of like the second option because we can support the next generation of Rails apps using a clean slate rather than hacking the existing tasks with more and more conditional logic. But, the second option is definitely more work. I do not use Capistrano with webpacker so I would need help from the community to put a PR together.
Option 1 is fairly easy and I could hack something together for that pretty quickly.
Thoughts?
+1 for the 2nd approach from my side as well, looks cleaner and more future proof :)
OK I put a you can help!
label on this issue to indicate that I am looking for the community to provide a PR. Please open one if you have a suggested implementation! 🙏
Does setting the asset_prefix like recommended below work? It worked for me.
http://blog.tap349.com/webpack/2018/05/22/webpack-troubleshooting/
edit: I actually had to enable sprockets because of various issues without it :(
This pull request is necessary when using webpacker and set :assets_prefix, 'packs'
.
Rollback is getting failed when i use set :assets_prefix, 'packs'
Rails assets manifest file (or backup file) not found.
Pls anyone can help me
Steps to reproduce
Deploy a project with assets built with Webpacker and without sprockets generating anything.
Expected behavior
Deploy succeeds
Actual behavior
Deploy fails because manifest files are missing
Hot-Fix
Adding a line to deploy.rb
Rake::Task["deploy:assets:backup_manifest"].clear_actions