object = { boolean activeModules = true, boolean entries = false, function (number percentage, string message, [string] ...args) handler, boolean modules = true, number modulesCount = 500, boolean profile = false }
function (number percentage, string message, [string] ...args)
The ProgressPlugin
provides a way to customize how progress is reported during a compilation.
Create an instance of ProgressPlugin
and provide one of the allowed params.
function
Provide a handler function which will be called when hooks report progress. handler
function arguments:
percentage
: a number between 0 and 1 indicating the completion percentage of the compilationmessage
: a short description of the currently-executing hook...args
: zero or more additional strings describing the current progressconst handler = (percentage, message, ...args) => {
// e.g. Output each progress message directly to the console:
console.info(percentage, message, ...args);
};
new webpack.ProgressPlugin(handler);
object
When providing an object
to the ProgressPlugin
, following properties are supported:
activeModules
show's active modules count and one active module in progress messageentries
show's entries count in progress messagehandler: function (percentage, message, ...args)
modules
show's modules count in progress messagemodulesCount
a minimum modules count to start with. Takes effect when modules
property is enabled.profile
tells ProgressPlugin
to collect profile data for progress steps.new webpack.ProgressPlugin({
entries: true,
modules: true,
modulesCount: 100,
profile: true,
handler: (percentage, message, ...args) => {
// custom logic
}
});
The following hooks report progress information to ProgressPlugin
.
Hooks marked with * allow plugins to report progress information using
reportProgress
. For more, see Plugin API: Reporting Progress
Compiler
Compilation