Using grunt instead of the asset pipeline.
- At the moment I have only done coffeescript compilation, not scss/css yet
- In my rails app, I have created a
./frontenddirectory structure like the above. - The
./frontend/coffeedir is where your "app" goes, it can be structured however you like, and contain.jsfiles. - The
./tasksfile contains some custom tasks I have written, I'll include them below, but they are:coffee.jscompile coffee-script files from./coffeeinto./tmpmaintaining directory structure.copy.jscopy files from./coffeeinto./tmpmaintaining directory structure (copies.jsfiles across as-is.ecojst.jsprecompile.ecotemplates into.jsfiles under aJST[]namespace - trivial to switch for handlebars or any JS template language with a precompile method.fingerprint.jsrename a file, appending the md5sum of its contents to the filename.
frontend.json, is sort of a manifest defining how to build/require our compiled js file. It works a lot like the sprockets manifests: list files you want to concat in coffee: []. You can use /**/, or / to glob files, and it won't pull in files twice.
Caveats at the moment: