Nice and tidy bundles of CSS and JS served by Rack.
Inspired by Managing Styles with Sass on Heroku.
- Sass - especially the Scss part - is pretty cool and I want to use it in my web apps.
- Some file systems (aka Heroku) are read-only so you can't "compile" to disk without dirty hacks.
- HTTP caching is pretty cool and we can leverage it to serve assets lickity-split.
- We also want:
- Stylesheets organized in lots of tiny files but that serve as one,
- JavaScript bundles organized expressively with YAML,
- JavaScript and CSS compression.
Stork is designed to be two simple Rack endpoints that will bundle, compress, and serve your stylesheets and javascripts.
If you're using Rails 3, using Stork might look something like this:
match "/stylesheets/:package.css" => Stork::StylesheetBundler
match "/javascripts/:package.js" => Stork::JavascriptBundler
Stork is a work in progress so I wouldn't go trying to install it just yet.
There's still a lot to do:
- Test it with Rails and maybe some other Rack based apps.
- Make sure it plays nicely with Compass.
- Build in Javascript support (including compression).
- Finally, make it available as a proper gem.