You can clone with
With the 1.0.6-2 handlebars package I was able to do this:
handlebars ../templates/*.handlebars -f ../templates/templates.js -k include -m
And all the templates in the templates directory would get built and pushed into templates.js.
But as of at least 1.0.10 I get this:
throw new Handlebars.Exception("You must pass a string or Handlebars AST t
Error: You must pass a string or Handlebars AST to Handlebars.precompile. You passed
at new Error (unknown source)
at Error.Handlebars.Exception (/usr/local/lib/node_modules/handlebars/lib/handlebars/utils.js:8:41)
at Object.exports.attach.Handlebars.precompile (/usr/local/lib/node_modules/handlebars/lib/handlebars/compiler/compiler.js:1240:11)
at processTemplate (/usr/local/lib/node_modules/handlebars/bin/handlebars:163:78)
at Array.forEach (native)
at Object.<anonymous> (/usr/local/lib/node_modules/handlebars/bin/handlebars:168:8)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
Am I doing something wrong?
Are any of the templates empty files?
By removing the empty templates the problem is fixed.
@kpdecker Ah, you got me! Yes I have a few... I'll add a comment to each and try again.
A pull request I am working on with recursive directory compilation will fix the issue involving empty template files.
Allow compilation of empty string
Just upgraded to 1.1.2, and seems like runtime still fails as "The partial ... could not be compiled when running in runtime-only mode" on empty templates.
Is it something with invokePartialWrapper's result var?