improve progress reporting

This commit is contained in:
Tobias Koppers 2019-11-12 14:35:19 +01:00
parent 58d6c26197
commit 586d5abc2c
1 changed files with 19 additions and 6 deletions

View File

@ -218,14 +218,20 @@ class SourceMapDevToolPlugin {
}
reportProgress(
(0.5 * fileIndex++) / files.length,
(0.5 * ++fileIndex) / files.length,
file,
"generate SourceMap"
"restored cached SourceMap"
);
return callback();
}
reportProgress(
(0.5 * fileIndex) / files.length,
file,
"generate SourceMap"
);
/** @type {SourceMapTask | undefined} */
const task = getTaskForFile(
file,
@ -263,9 +269,9 @@ class SourceMapDevToolPlugin {
}
reportProgress(
(0.5 * fileIndex++) / files.length,
(0.5 * ++fileIndex) / files.length,
file,
"generate SourceMap"
"generated SourceMap"
);
callback();
@ -343,6 +349,13 @@ class SourceMapDevToolPlugin {
const sourceMap = task.sourceMap;
const source = task.source;
const modules = task.modules;
reportProgress(
0.5 + (0.5 * taskIndex) / tasks.length,
file,
"attach SourceMap"
);
const moduleFilenames = modules.map(m =>
moduleToSourceNameMapping.get(m)
);
@ -447,9 +460,9 @@ class SourceMapDevToolPlugin {
assets,
err => {
reportProgress(
0.5 + (0.5 * taskIndex++) / tasks.length,
0.5 + (0.5 * ++taskIndex) / tasks.length,
task.file,
"attach SourceMap"
"attached SourceMap"
);
if (err) {