Undertaker Config Registry
A registry for Gulp 4 (Undertaker)
How to work
commonConf |> taskConfFn => taskConf |> taskDefFn => task
Gulp Structure
gulpfile.babel.js/
config/
copy.js
tasks/
copy.js
index.js
** filename should be prefer the task name **
// config/copy.js { return src: `/**` output: `` }
// tasks/copy.js; { return gulp ;} copy { gulp;}; ;
// index.js;;; const baseConfig = src: './src' dist: './public'; const configRegistry = baseConfig ;
Run gulp copy
will be work well or defined custom task queues by gulp.series
or gulp.parallel
Dev mode
taskDefFn.watch
will be called only in dev model
configRegistry
Mutli configure
For taskConfFn
, a special hook be provided.
files
will help to create sub task and will merge common options
which exists,
without changing TaskDefFn
ex.
{ return files: src: `/target1/**` output: `/target1` options: a: 2 b: 1 src: `/target2/**` output: `/target2` options: a: 1 }
will be
// taskConf_0 src: `/target1/**` output: `/target1` options: a: 2 b: 1 // taskConf_1 src: `/target1/**` output: `/target1` options: a: 1