Last active
January 2, 2016 10:09
-
-
Save StevenLangbroek/8288315 to your computer and use it in GitHub Desktop.
Marionette Renderer override for grunt-contrib-handlebars.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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