diff --git a/Gruntfile.js b/Gruntfile.js index d29fe93..2a6e8d5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -74,6 +74,18 @@ module.exports = function(grunt) { "tmp/amd_wrapper.js": ["test/fixtures/template.html"] } }, + amd_wrapper_no_ns: { + options: { + templateSettings: { + variable: 'obj' + }, + amdWrapper:true, + namespace:false + }, + files: { + "tmp/amd_wrapper_no_ns.js": ["test/fixtures/template.html"] + } + }, uglyfile: { options: { templateSettings: { diff --git a/tasks/jst.js b/tasks/jst.js index f2810fd..5a73a25 100644 --- a/tasks/jst.js +++ b/tasks/jst.js @@ -83,7 +83,7 @@ module.exports = function(grunt) { if (options.namespace !== false) { // Namespace has not been explicitly set to false; the AMD // wrapper will return the object containing the template. - output.push(" return " + nsInfo.namespace + ";" + lf); + output.push(" return " + nsInfo.namespace + ";"); } output.push("});"); } diff --git a/test/expected/amd_wrapper.js b/test/expected/amd_wrapper.js index c8902d6..670a27d 100644 --- a/test/expected/amd_wrapper.js +++ b/test/expected/amd_wrapper.js @@ -11,4 +11,5 @@ return __p }; return this["JST"]; + }); \ No newline at end of file diff --git a/test/expected/amd_wrapper_no_ns.js b/test/expected/amd_wrapper_no_ns.js new file mode 100644 index 0000000..26bf450 --- /dev/null +++ b/test/expected/amd_wrapper_no_ns.js @@ -0,0 +1,11 @@ +define(function(){ + +return function(obj) { +var __t, __p = '', __e = _.escape; +__p += '