Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parallel() {
var create = this._settle ? bach.settleParallel : bach.parallel;
//通过参数获取存在寄存器(registry)中的 taskFunctions(数组形式)
var args = normalizeArgs(this._registry, arguments);
//新增一个扩展对象,用于后续给 taskFunction 加上生命周期
var extensions = createExtensions(this);
//将 taskFunctions 里的每一个 taskFunction 加上生命周期,且异步化taskFunction,安排它们并发执行(调用fn的时候)
var fn = create(args, extensions);
fn.displayName = '';
//设置初步 metadata,方便外层 this.task 接口获取依赖关系
metadata.set(fn, {
name: fn.displayName,
branch: true, //表示当前 task 是被依赖的(parallel)任务
tree: {
label: fn.displayName,
type: 'function',
function parallel() {
var create = this._settle ? bach.settleParallel : bach.parallel;
var args = normalizeArgs(this._registry, arguments);
var extensions = createExtensions(this);
var fn = create(args, extensions);
var name = '';
metadata.set(fn, {
name: name,
branch: true,
tree: {
label: name,
type: 'function',
branch: true,
nodes: buildTree(args),
},
});
gulp.task('default', ['clean'], function(cb) {
bach.series(styles, scripts, images, fonts)(function(err) {
if(err) {
handleErrors(err);
} else {
return cb();
}
})
})
}
]
setTimeout(function () {
try {
vinyl.src(`templates/*.yml`)
.pipe(replace(patterns))
.pipe(vinyl.dest(`dist`))
} catch (e) {
err(e)
} finally {
cb(null, 5)
}
}, 1000)
}
return bach.settleSeries(fn1, fn2, fn3, fn4)()
}