If building AMD modules, and only one template is being compiled,

return the compiled template from the AMD module
This commit is contained in:
James Maroney
2013-04-08 10:36:43 -04:00
parent 075fdb8ac4
commit 85a21f2359
+2
View File
@@ -168,8 +168,10 @@ function processTemplate(template, root) {
if (argv.simple) {
output.push(handlebars.precompile(data, options) + '\n');
} else if (argv.partial) {
if(argv.amd && argv._.length == 1){ output.push('return '); }
output.push('Handlebars.partials[\'' + template + '\'] = template(' + handlebars.precompile(data, options) + ');\n');
} else {
if(argv.amd && argv._.length == 1){ output.push('return '); }
output.push('templates[\'' + template + '\'] = template(' + handlebars.precompile(data, options) + ');\n');
}
}