Permalink
Browse files

Support `then-jade` in `jade.render` function

  • Loading branch information...
1 parent ee2234e commit 216d49905d9e5c64357bf91352f80c252010b9d6 @ForbesLindesay ForbesLindesay committed Jan 6, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/consolidate.js
View
@@ -169,7 +169,14 @@ exports.jade = function(path, options, fn){
*/
exports.jade.render = function(str, options, fn){
- var engine = requires.jade || (requires.jade = require('jade'));
+ var engine = requires.jade;
+ if (!engine) {
+ try {
+ engine = requires.jade = require('jade');
+ } catch (err) {
+ engine = requires.jade = require('then-jade');
+ }
+ }
engine.render(str, options, fn);
};

0 comments on commit 216d499

Please sign in to comment.