People talk shit on Sprockets and the Asset Pipeline all the time. I get it. It's pretty confusing and when it breaks it can break in really undesirable ways. I was originally very sceptical, and I strongly considered upgrading to Rails 3.2 with sprockets disabled.
I didn't, and I'm glad I've stuck with the pipeline. Here's why:
-
If you're using digested assets (by default you are), asset expiry just works. No cache clearing during dev, no "wait a few minutes for the CSS to expire", no expiring every asset on every deploy, no deployment issues where people get new HTML and old CSS or JS. Sprocket's digest strategy has so far been excellent and I'm glad it's there.
-
SASS and CoffeeScript just work. No running
guard
orcompass
to watch and auto-compile your shit, relatively seamless integration into Rails, and effective separation of vendored code from application code.