Open alexus85 opened 9 years ago
I think the _
part should be configurable too.
I propose a solution like this:
config
amd: {
'underscore': '_'
}
code (untested)
var amdRequirements = [];
var amdImports = [];
_.each(options.amd, function(v, k) {
amdRequirements.push(k);
amdImports.push(v);
});
output.unshift('define(' + JSON.stringify(amdRequirements) + ', function(' + amdImports.join() + ') {')
result
define(['underscore'], function(_) {
It would be great if the option.amd was working similarly as in the grunt-contrib-handlebars (since it's very similar) This would enable users to define the library name right in the template init function..
gruntfile.json
jst.js
result: