Create a custom reporter
mainYou can provide your own reporter to control how build progress is displayed. A reporter can be a class instance or a plain object containing hook functions. You do not need to implement all functions; webpackbar only calls the ones that exist.
Important: When using a custom reporter, set fancy: false and basic: false in your configuration to avoid conflicts with default reporters.
Reporter Hooks
Each hook receives a context object. You can access the current status via context.state.
const logger = {
start(context) {
// Called when (re)compile is started
},
change(context) {
// Called when a file changed on watch mode
},
update(context) {
// Called after each progress update
},
done(context) {
// Called when compile finished
},
progress(context) {
// Called when build progress updated
},
allDone(context) {
// Called when _all_ compiles finished
},
beforeAllDone(context) {},
afterAllDone(context) {},
};Context State Schema
The context.state object contains the following fields:
{
start,
progress,
message,
details,
request,
hasErrors
}const logger = {
start(context) {
// Called when (re)compile is started
},
change(context) {
// Called when a file changed on watch mode
},
update(context) {
// Called after each progress update
},
done(context) {
// Called when compile finished
},
progress(context) {
// Called when build progress updated
},
allDone(context) {
// Called when _all_ compiles finished
},
beforeAllDone(context) {},
afterAllDone(context) {},
};
// context.state schema:
// {
// start, progress, message, details, request, hasErrors;
// }