javascript - Ignoring task dependencies in gulp.js -
i have following task
gulp.task('sass-build', ['clean-build'], function () { // stuff });
which requires clean-build
finished before starting. however, use task gulp.watch
without clean-build
dependency.
i'm aware solve helper task suggested in skipping tasks listed dependencies in gulp, require using gulp.run
(which deprecated) or gulp.start
(which isn't documented because it's considered bad practise).
what better way of doing this? or way use gulp.run
or gulp.start
?
the approach showed in linked question not bad. instead of gulp.run
can use simple functions same:
var sassfunction = function() { return gulp.src('blahbla') .pipe(bla()) } gulp.task('sass-build', ['clean-build'], function () { return sassfunction() }); gulp.task('sass-dev', function () { return sassfunction(); }); gulp.task('watch', function() { gulp.watch('your/sass/files/**/*.scss', ['sass-dev']) });
your other approach not bad , incorporated gulp 4.
gulp.task('default', gulp.series('clean-build', gulp.parallel('sass-build')));
something out for, since changes dependency trees completely.
Comments
Post a Comment