Created
July 3, 2012 23:49
-
-
Save zdennis/3044199 to your computer and use it in GitHub Desktop.
Make Middleman compile coffee-script using bare mode.
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
# | |
# Add the following to Middleman's config.rb: | |
# | |
CoffeeScript.class_eval do | |
class << self | |
def compile_with_bare(*args) | |
options = args.pop if args.last.is_a?(Hash) | |
(options ||= {})[:bare] = true | |
args << options | |
compile_without_bare(*args) | |
end | |
alias_method :compile_without_bare, :compile | |
alias_method :compile, :compile_with_bare | |
end | |
end |
Even easier (actually it is working):
Tilt::CoffeeScriptTemplate.default_bare = true
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank for providing a solution. Why is
Tilt::CoffeeScriptTemplate.default_bare = true
not working?