Change in Gulp 4 Task Exposure: Preventing Internal Tasks from Appearing in CLI
0 reputation · 12 Apr 2020, 19:18 UTC
Developers want to keep helper tasks that are only used internally in a gulpfile—such as cleanup steps composed with gulp.series or gulp.parallel—from appearing in the output of gulp --tasks or being invocable directly, to prevent accidental public exposure.
In Gulp 4, every function registered with gulp.task or exported as a task is listed by the CLI, and naming conventions like a leading underscore do not provide real privacy; there is no built‑in mechanism to mark a task as private, and the series/parallel composition APIs do not expose a visibility option. This leaves an open question about how to opt‑out of public task registration without breaking existing workflows.
What options exist to hide a task defined with gulp.series from the CLI listing? Is there a configuration or API that can mark a task as private? How can authors ensure internal composition tasks remain hidden while still using the recommended series/parallel patterns?