question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gulp 4: gulp.task('default', 'build') should be same as gulp.task('default', gulp.series('build'))

See original GitHub issue

Loving the new gulp.series() and gulp.parallel() flow, but I feel it shouldn’t be necessary to type:

gulp.task('default', gulp.series('build'))

When the following would communicate the intent even more clearly, and is less code:

gulp.task('default', 'build')

The latter currently fails with AssertionError: Task function must be specified.

See also https://github.com/gulpjs/gulp/issues/771.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:8
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
flying-sheepcommented, Dec 9, 2015

another alternative would be to disallow all this and just do:

let build = gulp.series(clean, gulp.parallel(scripts, images))
let default = build

gulp.task(build)
gulp.task(clean)
gulp.task(watch)
gulp.task(default)
0reactions
flying-sheepcommented, Oct 20, 2016

as it is now, i just ignore gulp.task as well as the possibility of referring to tasks by name:

instead i use export function release() { ... } to define tasks and always pass the functions directly

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Tasks | gulp.js
Tasks can be considered public or private. ... To register a task publicly, export it from your gulpfile. ... exports.default = series(clean, build);....
Read more >
A quick guide for switching to gulp 4 | by Jhey Tompkins
Let's consider a real use case. A common default task is something like develop . This may have once looked like gulp.task('develop', [' ......
Read more >
The new task execution system - gulp.parallel and gulp.series
First clean, then scripts and styles in parallel, and after that we can execute the default task function. There are however several problems ......
Read more >
Everytime I run gulp anything, I get a assertion error.
Starts a BrowerSync instance gulp.task('server', ['build'], ... You don't need to downgrade your gulp from gulp 4. Use gulp.series() to ...
Read more >
How to use the gulp.parallel function in gulp - Snyk
task ('default', gulp.series( 'test', 'build', 'watch' ));. Was this helpful ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found