Skip to content

Instantly share code, notes, and snippets.

@StevenLangbroek
Last active January 2, 2016 10:09
Show Gist options
  • Save StevenLangbroek/8288315 to your computer and use it in GitHub Desktop.
Save StevenLangbroek/8288315 to your computer and use it in GitHub Desktop.
Marionette Renderer override for grunt-contrib-handlebars.
handlebars: {
compile: {
options: {
namespace: "JST",
processName: function(filePath){
return filePath.replace('assets/coffee/backbone/apps/', '').replace('.hbs', '');
}
},
files: {
"assets/js/templates.js": "assets/coffee/**/*.hbs",
}
}
}
do (Marionette) ->
_.extend Marionette.Renderer,
render: (template, data) ->
throw "Template #{template} not found!" unless JST[template]
JST[template](data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment