I have a main task called build, in this task in dev mode, i want to run watchers.
During production I don't need to run any watchers,
gulp.task('build', cb => {
return $.runSequence(
'globals',
'inline',
'lazy',
(production ? ['empty'] : ['globals:watch', 'inline:watch', 'lazy:watch']),
cb
);
});
With runSequence
i tried passing in false
and null
as a param but it still tries to treat it as a taskname.
So the solution I came up with was to run a task, that does nothing:
gulp.task('empty', cb => {
return cb();
});
Is this the right way? It seems to only work sometimes and I'm not really sure why.
Any help would be great