This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.
Message originally sent by slack user U71TN2WF04X
Hi everyone Has anyone moved files from app/assets/images/... into packs? Im struggling to make it work as it does not appear on my public/packs/manifest.json
<@U71TN2WF04X> you mention app/assets/images/... and then public/packs/manifest.json but app/assets is normally handled by sprockets (or propshaft) while the files in public/packs/ are normally generated by webpacker. or so I remember.
but we havenāt been able to move the files from app/javascripts/* which are the ones handled by webpacker. We didnāt try too hard because itās not the focus yet, though.
Weāll most probably migrate out of webpacker to other stuff. Weāve already migrated all our JS code to use importmap. The only code left in webpacker is CSS for now.
<@U71TN2WF04X> this might be a shoot in the dark, but did you try adding your packsā assets directories to the additional_paths setting in config/webpacker.yml? That might work.
We also use esbuild rather than webpacker, not sure how easy it is to replicate. I built a system that detects *.esbuild.js/ts files inside a pack, and creates a Rake task to build that file using esbuild
(seems you linked to an internal Slack rather than the Propshaft docs in your first message)
Itās been like a year since I switched, I donāt remember if I did anything more than follow those instructions. I donāt remember it being particularly difficult though once the switch off of Webpacker was done.
Minor note, we donāt use jsbundling-rails or cssbundling-rails since all they really do is add rake tasks to build a single JS/CSS file, since we have multiple files across packs I made custom rake tasks for them instead.