Using strings when registering with gulp.task
Created by: jmm
Re: this entry in the changelog:
using strings when registering with
gulp.task
should only be done when you will call the task with the CLI
A) What is the point of this advice? Is it that you can omit the string (the name
arg) to make a task not callable from the CLI?
There was a pretty confusing discussion about that starting here.
Will this be callable via the CLI (gulp whatever
)?:
gulp.task(function whatever () {});
// As opposed to
gulp.task('whatever', function () {});
B) The API documentation for .task()
should discuss this, right?
C) It looks like it will be an error to do gulp.task(function () { "I'm anonymous"; })
, but if so the documentation doesn't make that clear.
D) Is displayName
meant to be part of the API or it's just for some internal use?
var f = function () {};
f.displayName = 'whatever';
gulp.task(f);