Exclude individual css from assets pipeline

2013-12-22

When in the need to remove certain CSS files from your application.css’s require_tree:

# application.css
/*
*= require_self
*= require_tree .
*/

Use sprocket’s stub directive:

# application.css
/*
*= require_self
*= require_tree .
*= stub whatevercssyoudontwanttoload[.css]
*/

Note: Best practice of course is to add individual stylesheets into your application.css rather than a full on require_tree .. But in the event that you require to still use require_tree, the above may help you.

I’m currently working on fyra.sh, a CLI-first static site deployment tool where you push your site and it’s served globally through a built-in CDN, without the overhead of heavy platforms.