4 ms·
I use Grunt (http://gruntjs.com http://gruntjs.com) to compile them for production. handlebars: { compile: { options: {
by philfreo 14y ago
I use Grunt (http://gruntjs.com http://gruntjs.com) to compile them for production.
handlebars: {
compile: {
options: {
namespace: "JST"
},
files: {
"dist/debug/templates.js": ["templates/**/*.hbs"]
}
}
},
Then you can concat templates.js with the rest of your JS and your template functions are ready to go!
https://npmjs.org/package/grunt-contrib-handlebars https://npmjs.org/package/grunt-contrib-handlebars
- latchkey 14y agoFor a multiple page website, it seems like it is a waste to serve up all of the templates for the entire site. I try to serve the template that is specific for the page.