-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Question: Gulp 4.0 Conventions For Tasks #771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can also do this function clean() {}
function all() {}
gulp.task('default', gulp.series(clean, all)) series and parallel take strings or functions, strings just look up the function from the task object |
Docs for the underlying lib: https://github.com/phated/bach For the 4.0 release I really want to consolidate the spiderweb of docs into one place |
Everything is just function composition in gulp4. There should be no more need to add extra wrappers, etc. |
What's the simplest form for task aliasing? (for the default task?)
|
But is way powerful. gulp.task('css:pipeline', gulp.series('stylus', 'autoprefixer'));
gulp.task('js:pipeline', gulp.series('jsx', 'lint', 'minify'));
gulp.task('default', gulp.parallel('js:pipeline','css:pipeline')); |
Yeah! I certainly don't want to downplay the many-to-one feature. And I don't think an increased api surface area is warranted (e.g. |
I didn't mean to hijack the thread. Should this be a separate discussion? |
@jasonkarns I will try to answer here, but if it isn't satisfactory, please open a new issue. The simplest way to alias a task is as such: function build(){
// do your build stuff
}
gulp.task(build);
gulp.task('default', build); Remember, everything is a function 😄 |
Closing this since it already exists on the 4.0 branch |
|
With 4.0, is the intended code flow(gulp convention) no longer calling outside normal javascript functions(non task wrapped) inside a wrapped task?
The reason why I ask is because I see:
gulp.task('default', gulp.parallel('clean', 'all'));
whereclean
andall
are also gulp tasks called within taskdefault
.In 3.0, this would be done with
Reference:
#458 (comment)
#755 (comment)
The text was updated successfully, but these errors were encountered: