Looking for some help with a problem similar to the one mentioned in this Stack Overflow question. Since that question hasn't been answered yet, I decided to create my own post.
I'm currently attempting to precompile my handlebars template files into a js file. Originally, I used the handlebars npm task to manually compile it, and everything worked smoothly with the generated output. The command I ran looked like this:
handlebars *.handlebars -f template.js
This produced the following code:
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['address-book-contact-form'] = template(function (Handlebars,depth0,helpers,partials,data) {
// Output omitted for brevity...
});
// More template functions here...
Now, I've switched to compiling my templates using grunt with grunt-contrib-handlebars. However, the output is different from what I got with manual compilation. Here's an example of the new output:
Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
// Output omitted...
});
// Additional template functions go here...
If anyone has any insights on why these outputs differ and how to align the grunt output with the manual npm handlebars compilation, I would greatly appreciate your advice.