gulp-jade-namespace
v1.2.3
Published
Wrap compiled Jade client templates with custom namespace
Downloads
5
Maintainers
Readme
gulp-jade-namespace
Wrap Jade client templates with custom namespace.
Replace function template(locals) {
with
window["Templates"] = window["Templates"] || {};
window["Templates"]["path_to/template_without_extention"] = function(locals) {
Install
$ npm install gulp-jade-namespace --save-dev
Usage
var gulp = require('gulp');
var jade = require('jade');
var namespace = require('gulp-jade-namespace');
gulp.task('client-templates', function () {
return gulp.src('templates/**/*.jade')
.pipe(jade({
client: true
}))
.pipe(namespace())
.pipe(gulp.dest('public/templates/'));
});
Options
{
"namespace": "Templates",
"global": true,
"compressed": false
}
License
MIT © Nikolay Solovyov