Created
June 1, 2011 19:58
-
-
Save rweald/1003158 to your computer and use it in GitHub Desktop.
Using Barista with Jammit to package and compile CoffeeScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simply run rake jammit:package to compile your coffeescript and then package up all your assets | |
# including the newly compiled javascripts | |
namespace :jammit do | |
task :package do | |
Rake::Task["barista:brew"].invoke | |
Jammit.package! | |
end | |
end |
I apologize for the ambiguity. This is a custom rake task that I have in lib/tasks of a Rails 3.0 project. I use it to compile my coffeescript into the public/javascripts folder where Jammit can then bundle it up as part of my assets package.
Quite handy for heroku if you don't want to have to deal with getting coffeescript to compile on heroku. Simply run this task as part of a git commit hook before you push up the heroku.
You can just run:
rake jammit:package
Thanks rweald, I'll have to remember this bit when I start experimenting with heroku.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm curious... What's the context here? As in, which file are you adding this to?