grunt-caveman
Advanced tools
Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "grunt-caveman", | ||
"description": "Pre-compile Caveman templates.", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/andrewchilds/grunt-caveman", | ||
@@ -18,3 +18,3 @@ "author": { | ||
"dependencies": { | ||
"caveman": "0.1.3", | ||
"caveman": "0.1.4", | ||
"lodash": "2.4.1" | ||
@@ -21,0 +21,0 @@ }, |
@@ -30,3 +30,3 @@ # grunt-caveman | ||
### Using pre-compiled templates on the client | ||
### Rendering pre-compiled templates on the client-side: | ||
@@ -45,2 +45,6 @@ ```js | ||
src: ['path/to/templates/*.html'], | ||
data: { | ||
foo: [1, 2, 3], | ||
bar: true | ||
}, | ||
render: { | ||
@@ -47,0 +51,0 @@ 'indexPage': 'public/index.html', |
@@ -23,2 +23,6 @@ /* | ||
src: ['path/to/templates/*.html'], | ||
data: { | ||
foo: [1, 2, 3], | ||
bar: true | ||
}, | ||
render: { | ||
@@ -40,3 +44,3 @@ 'indexPage': 'public/index.html', | ||
if (this.data.src && this.data.render) { | ||
exports.compileAndRenderTemplates(grunt, this.data.src, this.data.render); | ||
exports.compileAndRenderTemplates(grunt, this.data.src, this.data.render, this.data.data); | ||
} | ||
@@ -71,3 +75,3 @@ }); | ||
exports.compileAndRenderTemplates = function (grunt, src, files) { | ||
exports.compileAndRenderTemplates = function (grunt, src, files, data) { | ||
var path = require('path'); | ||
@@ -92,5 +96,5 @@ var Caveman = require('caveman'); | ||
_.each(files, function (dest, template) { | ||
grunt.file.write(dest, Caveman.render(template)); | ||
grunt.file.write(dest, Caveman.render(template, data || {})); | ||
grunt.log.writeln(template.cyan + ' -> ' + dest.cyan); | ||
}); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5375
80
60
+ Addedcaveman@0.1.4(transitive)
- Removed@xmldom/xmldom@0.8.10(transitive)
- Removedcaveman@0.1.3(transitive)
- Removedfileset@0.1.8(transitive)
- Removedgaze@0.3.4(transitive)
- Removedgrowl@1.7.0(transitive)
- Removedjasmine-growl-reporter@0.0.3(transitive)
- Removedjasmine-node@1.13.1(transitive)
- Removedjasmine-reporters@2.5.2(transitive)
- Removedmkdirp@0.3.51.0.4(transitive)
- Removedrequirejs@2.3.7(transitive)
- Removedunderscore@1.13.7(transitive)
- Removedwalkdir@0.4.1(transitive)
Updatedcaveman@0.1.4