gulp-webserver
gulp-webserver copied to clipboard
Do not reload on deleted file
Currently, I have this task to reload webserver when .build/index.html
file is changed (see below). The problem is that the server is also reloaded when this file is deleted. Is there a way to reload only when the file is acutally updated?
gulp.task('ws', function () {
return gulp.src('.build/')
.pipe(webserver({
livereload: {
enable: true,
filter: function(fileName) {
return fileName.match(/.build\/index\.html$/) ? true : false;
}
}
}));
});
+1 for this. I have a semi-large concatenated js file that is rebuilt every time a source changes. This triggers one reload each for the deletion and replacement using gulp.dest.