Closed nicjansma closed 10 years ago
Thanks for the PR.
Do you feel like the whole // ensure 'handlebars' is the first dependency
checking is necessary?
Can we just explain in the readme to do that and keep the task simpler? Let me know your thoughts!
We need to make sure we specify 'handlebars'
first in the define([...])
array, since the first one is the one we expose as Handlebars
in via the callback function:
define([" + amdString + "], function(Handlebars) { ...
But yes, it would be simpler if we just specified that requirement in the docs. It's up to you, I can change the PR if you don't want that complexity added.
I personally would love to have it in the documentation instead. The other thing: is there a need to expose other modules, i.e function(Handlebars, Module1, Module2) {
?
or is this only for Handlebars helpers?
PR updated (docs updated, logic in task removed).
In my case, with the handlebars.helpers
module I use, no, there is no need to expose that module. The helpers simply extend the Handlebars object and aren't used within the templates module directly.
The difficulty I see with trying to expose those other modules is as with your example, what do we name them such that they're easy to use? IMO, exposing the other modules isn't needed, and we could wait for a use case before worrying about it.
This changes
options.amd
so it can be anArray
instead of just aboolean
orstring
.This PR is similar to https://github.com/gruntjs/grunt-contrib-handlebars/pull/78, except it just uses the
amd
option and doesn't require an additionalamdRequire
option.