Skip to content

Server only restarts if I run gulp with gulp default "default" command #58

@LantosIstvan

Description

@LantosIstvan

I have the following Gulpfile:

const server = gls.new([
  '--trace-deprecation', '--trace-sync-io', 'bin/www',
]);
gulp.task('start', () => {
  return server.start();
});

...

gulp.task('app', gulp.parallel('start', 'css', 'uglify', 'files'));

gulp.task('watch:start', () => {
  //gulp.watch(paths.app, gulp.series('start'), server.start); // restart my server
  gulp.watch(paths.app, gulp.series('start'), (file) => {
    server.notify.apply(server, [file]);
  });
});

...

gulp.task('watch', gulp.parallel('watch:start', 'watch:stylus', 'watch:css', 'watch:uglify', 'watch:files'));

gulp.task('default', gulp.parallel('app', 'watch'));

If I run gulp default, the server only restart one times only, at the first when I do any modifications for example in my app.js. Meanwhile, if I re-save multiple times my main.styl file, it will re-compile the minified CSS every single time, works as expected.

I had to run gulp default "default" to be responsive every server restart, but than I run every command two times, which I think is wasting.

I running Gulp 4 now, but it was the same with Gulp 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions