Permalink
Browse files

Updated jade compile api so it works with both jade 1.0.0+ and older …

…versions of jade.
  • Loading branch information...
1 parent b839254 commit 06fb42d0e2bdabc377c9661e58e9169620395caa @cengebretson cengebretson committed Jan 7, 2014
Showing with 7 additions and 4 deletions.
  1. +3 −2 lib/compilers.js
  2. +1 −1 package.json
  3. +3 −1 src/compilers.coffee
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,6 +1,6 @@
{
"name": "hem",
- "version": "0.3.5",
+ "version": "0.3.6",
"description": "stiches CommonJS, and ties up other lose ends of web-app development.",
"keywords": [
"spine",
View
@@ -77,7 +77,9 @@ try
compilers.jade = (path) ->
content = fs.readFileSync(path, 'utf8')
try
- template = jade.compile content,
+ # look first for compileClient (starting with jade v1.0.0) and fallback compile if not defined
+ jCompiler = jade.compileClient or jade.compile
+ template = jCompiler content,
filename: path
compileDebug: compilers.DEBUG
client: true

1 comment on commit 06fb42d

Contributor

jamiter commented on 06fb42d Feb 14, 2014

Could this be published to npm? I'm having this problem at the moment.

Please sign in to comment.