gruntjs/grunt-contrib-handlebars

Using multiple pre compiled templates

Opened this issue · 0 comments

Ciao!
We're using grunt-contrib-handlebars in a single page application framework with some different applications. They share some templates, for example a layout.m and for each of this application we create a different pre compiled file, something like:

  • app1-templates.js
  • app2-templates.js
    ...
    Since they share some templates, when we load the different pre compiled files, we have that templates with the same name are overwritten into the Handlebars object.
    In particular, in each file we have:

Handlebars.registerPartial('layout',......)

so, the last processed overwrites the previous one. Is there any way to load different pre-compiled templates into the same Handlebars object (inside a node.js App) avoiding this issue?
Thanks