using gulp to setup a local webserver

I ran into this problem when I was inadvertently starting the webserver right after my clean task so the directory didn't actually exist because it had just been removed. The problem was here:

gulp.task('watch', ["build", "webserver"]);

Which was starting the build task first, which was starting a clean task before it ran.

gulp.task('build', ["clean"])

To fix this I switched to starting the webserver inside the watch task instead of a dependency of the watch task

gulp.task('watch', ["build"], function() {
    return gulp.start(['webserver']);
});

mostly it means its not finding index.html

return gulp.src('./app/')
  .pipe(plugin.webserver({
      host: '0.0.0.0',
      port: 6639,
      livereload: true,
      open: true,
      fallback: './dist/index.html'
  }));

mostly its the problem with the path setting.. try below in ur case

  gulp.src('dist')
    .pipe(webserver({
         ......
    }));

Tags:

Webserver

Gulp