Skip to content

Instantly share code, notes, and snippets.

@zdennis zdennis/config.rb
Created Jul 3, 2012

Embed
What would you like to do?
Make Middleman compile coffee-script using bare mode.
#
# 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
@rriemann

This comment has been minimized.

Copy link

commented Jul 1, 2014

Thank for providing a solution. Why is Tilt::CoffeeScriptTemplate.default_bare = true not working?

@rriemann

This comment has been minimized.

Copy link

commented Jul 1, 2014

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
You can’t perform that action at this time.