-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handlebars Namespace config #69
Comments
I would also like to see this config option to avoid namespace conflicts. Trying to wrap my brain around Grunt and RequireJS, so much more of a headache it seems than Brunch! Anyway, I'm stuck trying to move a project from compile-every-time Handlebars templates within script blocks (loaded via jQuery). If I leave the compiled output as-is, Handlebars is undefined within the AMD wrapper and execution fails at this point. When I set wrapped to false in my Gruntfile options for grunt-contrib-handlebars, I can render templates if I call Handlebars.template() upon rendering -- but that is a bit cumbersome. I can also get the templates to work with this wrapping on by removing/renaming the first Handlebars arg from the AMD wrapper in the compiled templates file. The second definition of Handlebars within the inner template function then points to the correct requirejs.config path for the module (which is resolved as a bower component for the project). Unfortunately, any changes to the compiled output is obviously obliterated upon recompilation. |
See my comment here, #96 (comment), it would solve this issue. |
+1 |
I really appreciate the
namespace
config option, so that I can put my templates in (e.g.)MyApp.Templates
. However, I've also got my Handlebars namespaced asMyApp.Handlebars
. Is there a way to make the generated JS templates obey that namespace? As of now, they look something like this (for a simple<h1>Hello, World.</h1>
template):Note the explicit call to
Handlebars
. Can I change that to (e.g.)MyApp.Handlebars
so it looks something like this?The text was updated successfully, but these errors were encountered: