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.
Ahh, looks like you just answered one of my questions. It shouldn't be too hard. Specify target files for replacement, bit of regex to find the original filename, replace.