Skip to content

Commit 7da8734

Browse files
fix(amd): add support for namespace with dots
1 parent 3e673cd commit 7da8734

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tasks/handlebars.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,12 @@ module.exports = function(grunt) {
207207
if (useNamespace) {
208208
// Namespace has not been explicitly set to false; the AMD
209209
// wrapper will return the object containing the template.
210-
output.push('return ' + extractGlobalNamespace(nsDeclarations) + ';');
210+
211+
// if namespace is a function iterating over file for search global/root namespace
212+
// instead find the declared namespace formatted and allowing namespace with dots
213+
var namespace = _.isFunction(options.namespace) ?
214+
extractGlobalNamespace(nsDeclarations) : getNamespaceInfo().namespace;
215+
output.push('return ' + namespace + ';');
211216
}
212217
output.push('});');
213218
}

0 commit comments

Comments
 (0)