Asset Pipeline
What are some excellent resources to get a good foundational understanding of asset pipeline, esbuild, import maps, js bundling. I have a decent knowledge of Rails, but I have trouble understanding these concepts. I'd love a good deep dive course.
Hi Chuck,
Great question, this stuff changes a lot, especially the last few years. Good news though, the trend is to simplify things. The new asset pipeline uses Propshaft which will make sure your CSS and js files are ready to go in your Rails app. I like this Rails World talk that explains the basics of how Propshaft works.
https://www.youtube.com/watch?v=yFgQco_ccgg
You can use vanilla CSS right away and if you want to use Tailwind there is an excellent gem tailwindcss-rails that will set everything up for you. These can work side by side and you can use both in your app.
On the js side of things, importmaps is the default and a simpler way of adding javascript libraries and that is already set up for you on a new Rails app. If you want a little more control, you can use a different javascript bundler such as esbuild. The jsbundling-rails gem is what sets up either bun, esbuild, rollup or web pack to handle your javascript bundling.