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
./frontend
directory structure like the above. - The
./frontend/coffee
dir is where your "app" goes, it can be structured however you like, and contain.js
files. - The
./tasks
file contains some custom tasks I have written, I'll include them below, but they are:coffee.js
compile coffee-script files from./coffee
into./tmp
maintaining directory structure.copy.js
copy files from./coffee
into./tmp
maintaining directory structure (copies.js
files across as-is.ecojst.js
precompile.eco
templates into.js
files under aJST[]
namespace - trivial to switch for handlebars or any JS template language with a precompile method.fingerprint.js
rename 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: