diff --git a/CHANGELOG.md b/CHANGELOG.md index 29f8b213..5f280e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Master === +* Don't catch CoffeeScript errors when in build mode. * Extract load_paths so they aren't locked into the binary * Add middleman/rack for better config.ru support * Use centralized Logger and add benchmark methods diff --git a/middleman-core/lib/middleman-core/renderers/coffee_script.rb b/middleman-core/lib/middleman-core/renderers/coffee_script.rb index 88ce51e9..02b5d8f4 100644 --- a/middleman-core/lib/middleman-core/renderers/coffee_script.rb +++ b/middleman-core/lib/middleman-core/renderers/coffee_script.rb @@ -29,6 +29,8 @@ module Middleman # @param [Hash] locals # @return [String] def evaluate(context, locals, &block) + return super if context.build? + begin super rescue ::ExecJS::RuntimeError => e diff --git a/middleman-more/features/coffee-script.feature b/middleman-more/features/coffee-script.feature index 0251d678..cf30bcd2 100644 --- a/middleman-more/features/coffee-script.feature +++ b/middleman-more/features/coffee-script.feature @@ -14,4 +14,9 @@ Feature: Support coffee-script Scenario: Rendering broken coffee Given the Server is running at "coffeescript-app" When I go to "/javascripts/broken-coffee.js" - Then I should see "reserved word" \ No newline at end of file + Then I should see "reserved word" + + Scenario: Building broken coffee + Given a built app at "coffeescript-app" + Then the output should contain "error build/javascripts/broken-coffee.js" + And the exit status should be 1 \ No newline at end of file