gulp-check-include
v1.0.1
Published
Filter files by content
Downloads
1
Maintainers
Readme
gulp-check-include
Filter files by content
Usage
var gulp = require('gulp');
var filter = require('gulp-check-include');
gulp.src('./src/*.html')
.pipe(filter("I love this file"))
Or my use case for optimize render by nunjucks:
function WatchHtml(dir, fname) {
return gulp.src(dir)
.pipe(gulpif(fname !== undefined, filter(fname)))
.pipe(njkRender({
path: 'src/partials'
}))
.pipe(gulp.dest('./build'));
}
function watcher(cb) {
gulp.watch('./src/**/*.njk').on('change', function (file) {
if (file.includes("src\\partials\\")) {
WatchHtml('./src/*.njk', pth.basename(file));
} else {
WatchHtml(file);
}
});
cb();
}