23May

Reluctantly crouched at the starting line…

Posted by Elf Sternberg as Uncategorized

Sorry, but I’m working in Cakefiles this week, and Cake is still one of my favorite bands, especially Fashion Nugget.

As you know, I’m a big fan of Coffee, HAML, and Less.  However, I’m also a big fan of Require and Backbone.  Now, it’s true that Require can handle Coffeescript on the fly, but I’m also a firm believer in pre-compiling as much of my deployed assets as possible to reduce download and client pre-processing time.  Sending the Coffee, Less, and HAML.js processors to the browser to make your life easier doesn’t make the customer very happy.  And r.js, the Require.JS compiler and optimizer, likes a specific layout in order to work well.  So the solution is to mirror the ultimate layout in your js/css/html templates tree as coffee/less/haml templates, and then build them all into place.

The gist below is my first step toward doing this:

It’s a fairly simple thing, but it accomplishes everything I care about.  If you want to mirror your javascript libraries and images as well, you could build them with a ‘cp’ command to put them into the target directory automagically.

 

Comment Form

Subscribe to Feed

Categories

Calendar

May 2012
M T W T F S S
« Apr   Jun »
 123456
78910111213
14151617181920
21222324252627
28293031