Permalink
Browse files

Merge pull request #73 from marcusdb/7b75b34c54966ce1e429262d658e10a7…

…f20e8f4e

Adding handlebars compilations options support
  • Loading branch information...
2 parents 6bf50a9 + 7b75b34 commit 739d78ab02e03d32d7377c2e273c1a3fa2a572ef @tbranyen tbranyen committed Nov 3, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 tasks/handlebars.js
View
@@ -30,6 +30,10 @@ module.exports = function(grunt) {
grunt.registerMultiTask("handlebars", "Compile handlebars templates and partials.", function() {
var options = grunt.helper("options", this, {namespace: "JST"});
+ var handlebarsOptions ={};
+ if(!!this.data.handlebarsOptions){
+ handlebarsOptions=this.data.handlebarsOptions;
+ };
grunt.verbose.writeflags(options, "Options");
@@ -56,7 +60,7 @@ module.exports = function(grunt) {
src = grunt.file.read(file);
try {
- compiled = require("handlebars").precompile(src);
+ compiled = require("handlebars").precompile(src,handlebarsOptions);
// if configured to, wrap template in Handlebars.template call
if(options.wrapped) {
compiled = "Handlebars.template("+compiled+")";

0 comments on commit 739d78a

Please sign in to comment.