Permalink
Browse files

Added template properties: dest. Updated examples

  • Loading branch information...
1 parent 7a30810 commit e7c24817c76574234096f9ee72ad4fc0c04501d2 @eprev committed Feb 22, 2013
View
@@ -66,7 +66,7 @@ module.exports = function (grunt) {
template: function (data) {
// Make AMD module
return grunt.template.process(
- 'define(<%= JSON.stringify(name) %>, function () { return <%= contents %> ; });',
+ 'define(<%= JSON.stringify(name + ".js") %>, function () { return <%= contents %> ; });',
{data: data}
);
},
View
@@ -71,6 +71,7 @@ This function is called when template will be compiled. It takes an argument as
* `src` — path to the template
* `relSrc` — relative path to the template
+* `dest` — path to the compiled file
* `name` — template’s name (relative to the source directory and w/o the extension)
* `basename` — template’s basename
* `contents` — compiled template
@@ -147,7 +148,7 @@ grunt.initConfig({
template: function (data) {
// Make AMD module
return grunt.template.process(
- 'define(<%= JSON.stringify(relSrc) %>, function () { return <%= contents %> ; });',
+ 'define(<%= JSON.stringify(name + ".js") %>, function () { return <%= contents %> ; });',
{data: data}
);
},
View
@@ -57,6 +57,7 @@ module.exports = function (grunt) {
name = se ? relSrc.slice(0, -se.length) : relSrc;
contents = options.template({
src: src,
+ dest: dest,
relSrc: relSrc,
name: name,
basename: basename(name),

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit e7c2481

Please sign in to comment.