Skip to content Skip to sidebar Skip to footer

Grunt-contrib-handlebars Configuration Issue

I have an issue with the configuration of 'grunt-contrib-handlebars', below is my setup at the moment. handlebars: { compile: { options: { namespace: 'my.na

Solution 1:

Take a look my solution

enter image description here

I implemented it with browserify.

  1. I generated a .js file that contains all my templates.
  2. Than I required it with browserify. Example:

var templates = require('templates/all_templates_in_this_js_file_without_extension')();

3.And now I can use it like backbonejs template

Backbone.View.extend({
 template: templates.product, //or templates['product']render: function(){
   this.$el.html(this.template(this.model.toJSON()))
 }
});

Post a Comment for "Grunt-contrib-handlebars Configuration Issue"