Open
Description
recently i try to use interceptor of tapable, in the Interception section of readme:
tap: (tap: Tap) => void Adding tap to your interceptor will trigger when a plugin taps into a hook. Provided is the Tap object. Tap object can't be changed.
it means if i use a intecptor of tap method, when a plugin taps into a hook, the corresponding function will be invoked. However, the following code snippet does not work as expected.
code snippet:
const { SyncBailHook } = require('tapable')
const hook = new SyncBailHook(['name'])
hook.intercept({
tap:(tapInfo) => {
console.log(tapInfo)
}
})
hook.tap('1', function (name) {
console.log(name, '1')
})
hook.tap('2', function (name) {
console.log(name, '2')
return 'wrong'
})
hook.tap('1', function (name) {
console.log(name, '2')
})
tap of interceptor only be called when it execute hook.call('webpack')
.
version of tapable: 1.1.0
Metadata
Metadata
Assignees
Labels
No labels