Answer the question
In order to leave comments, you need to log in
How to rebuild exactly the file in which there were changes?
Good afternoon.
Probably someone knows how to compile only the file in which changes have occurred, for example, there are 20 files in the directory with the pug extension, there is a watcher that watches the change in the directory, when one file is changed, everyone is recompiled, mine is some kind of nonsense, when there are a lot of files, hellish pain begins, is it possible to monitor the file (it doesn’t matter which one) and if it has changed, compile it with its includes and not all 20.
I use gulp to build
// Pug task
gulp.task('pug', function buildHTML(cb) {
return gulp.src('pug/*.pug')
.pipe(pug())
.pipe(gulp.dest('./dist/'));
});
// Watch task
gulp.task('watch',function(){
global.isWatching = true;
// Modules pug
watch('pug/*.pug', function() {
return runSequence('pug', browserSync.reload);
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question