When compiling Handlebars templates with the NPM package, is there a way to manually adjust the name/index that is generated?
In my experience using Handlebars in various environments like Rails, NodeJS, and PHP, I've observed that the generated template names can differ. Sometimes it's based on the file basename, while other times it's the full file path.
For example, using
handlebars app/templates/*.hbs -n HandlebarsTemplates -e hbs
results in names like:
HandlebarsTemplates["my_template"]
But in other instances, it may look like this:
HandlebarsTemplates["app/templates/my_template"]
I haven't come across an option in the handlebars
script that allows for controlling this behavior.
Is it possible to configure this naming convention? Or is it a distinction between compiling in pure JS (via Handlebars.compile(source)
) versus using the CLI tool?
It would also be valuable to understand which of these naming styles aligns more closely with the recommended best practices for Handlebars usage.