Expose a method or parameter that tells you if the server is currently running
Would be great to be able to know when the server is running so i can change my build tasks accordingly.
Example if i'm building my source code and the server is running I want to pipe it to server() otherwise I'd not do it because it throws an error. Something that can be used with gulp-if would be even better.
From reading the source i noticed that this can be achieved by using the child variable.
so my build task now looks like this:
var server = require( 'gulp-develop-server' );
gulp.task('build', function() {
gulp.watch(config.src + '/**/*.*', ['build']);
return gulp.src(config.src + '/**/*')
.pipe($.babel())
.pipe(gulp.dest(config.dist))
.pipe($.if(server.child ? true : false, server(), $.util.noop()));
});
Though this should probably be documented somewhere. And maybe add a method that returns true/false based on whether server.child is set or not.
Hi, @Sk1Zy
This plugin provided server.child and server.isChanged in such use case, as you say.
But actually, these options must be provide as immutable.
We consider adding a method whether the server runs success/failure at next version.
Thanks.