There is the following gulp tasks:
// Processing templates task
gulp.task('templates', function() {
return gulp.src('app/**/*.slim')
.pipe(slim({pretty: true}))
.pipe(minifyHTML())
.pipe(gulp.dest(dist));
});
// Watching files for changes task
gulp.task('watch', function() {
gulp.watch('app/**/*.slim', ['templates']);
});
As you can see templates
task finds and transforms all .slim
files in .html
file. It works good. Also there is watch
task which watches changes and executes templates
task after it. But I want that after watch
task finds some changes in template A gulp will transform only template A, not all templates. I don't understand how I can get changed file and transform it. Please, help me. Thanks in advance.