插件的绑定和使用,继承 tapable 使用
_plugins
对象: { name: Array<{ apply: Function }> }
apply(Array<{ apply: Function }>)
apply
函数plugin(name: String, fn: { apply: Function })
hasPlugins(name: String): Array<{ apply: Function }>
applyPlugins(name: String, ...args)
applyPluginsWaterfall(name: String, init: any, ...args): any
applyPluginsBailResult(name: String, ...args): any
applyPluginsAsync/applyPluginsAsyncSeries(name: String, ...args, callback: Function -> void)
applyPluginsAsyncWaterfall(name: String, init: any, callback: Function -> void)
applyPluginsAsyncSeriesBailResult(name: String, ...args, callback: Function -> void)
applyPluginsParallel(name: String, ...args, callback: Function -> void)
applyPluginsParallelBailResult(name: String, ...args, callback: Function -> void)
hook
hook
抽象为类
tap
tapAsync
tapPromise
增加了
Promise
形式的异步
call
callAsync
promise
SyncHook
-> applyPlugins
SyncBailHook
-> applyPluginsBailResult
SyncLoopHook
SyncWaterfallHook
-> applyPluginsWaterfall
AsyncParallelHook
-> applyPluginsParallel
AsyncParallelBailHook
-> applyPluginsParallelBailResult
AsyncSeriesHook
-> applyPluginsAsync/applyPluginsAsyncSeries
AsyncSeriesBailHook
-> applyPluginsAsyncSeriesBailResult
AsyncSeriesWaterfallHook
-> applyPluginsAsyncWaterfall