Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion lib/compilers.js
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"karma": "0.8.0",
"jade": ">=0.28.2",
"file": ">=0.2.1",
"uglify-js": "~2.4.0"
"uglify-js": "~2.4.0",
"handlebars": "~1.1.2"
}
}
20 changes: 20 additions & 0 deletions src/compilers.coffee
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@ try
module._compile compilers.jade(filename), filename
catch err

try
handlebars = require('handlebars')

compilers.hbs = (path) ->
content = fs.readFileSync(path, 'utf8')
try
template = handlebars.precompile content,
separator: '\n'
knownHelpers: []
knownHelpersOnly: false
source = template.toString()
"module.exports = Handlebars.template(#{source});"
catch ex
throw new Error("#{ex} in #{path}")

require.extensions['.hbs'] = (module, filename) ->
module._compile compilers.hbs(filename), filename
catch err


try
stylus = require('stylus')

Expand Down
Empty file modified src/package.coffee
100644 → 100755
Empty file.