gulp-webserver icon indicating copy to clipboard operation
gulp-webserver copied to clipboard

Do not reload on deleted file

Open demisx opened this issue 9 years ago • 1 comments

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;
        }
      }
  }));
});

demisx avatar Dec 16 '14 22:12 demisx

+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.

dshefchik avatar Jan 16 '15 02:01 dshefchik