From 85a21f2359da7ad9e844996fbf3c2df5eea88459 Mon Sep 17 00:00:00 2001 From: James Maroney Date: Mon, 8 Apr 2013 10:36:43 -0400 Subject: [PATCH] If building AMD modules, and only one template is being compiled, return the compiled template from the AMD module --- bin/handlebars | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/handlebars b/bin/handlebars index 61886dac..1e46a35f 100755 --- a/bin/handlebars +++ b/bin/handlebars @@ -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'); } }