Ask A Question

Notifications

You’re not receiving notifications from this thread.

Asset Pipeline

chuckblake asked in General

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.

Reply

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.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,277+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.