event-callback-webpack-plugin
Add callbacks to webpack events.
Install
npm install --save-dev event-callback-webpack-plugin
Usage
import EventCallbackWebpackPlugin from 'event-callback-webpack-plugin';
export default {
plugins: [
new EventCallbackWebpackPlugin('done', () => {
console.log('Hello `done`!');
})
]
};
Or
import EventCallbackWebpackPlugin from 'event-callback-webpack-plugin';
export default {
plugins: [
new EventCallbackWebpackPlugin({
emit: (compilation, callback) => {
console.log('Hello `emit`!');
return callback();
},
'after-emit': (compilation, callback) => {
console.log('Hello `after-emit`!');
return callback();
}
})
]
};
Options
events
- (require) string
or object
webpack events.callback
- (optional) callback function.
Contribution
Feel free to push your code if you agree with publishing under the MIT license.