mirror of https://github.com/webpack/webpack.git
remove "pass" from progress plugin
we will eventually replace the optimizing with a loop plugin
This commit is contained in:
parent
140cbaad21
commit
96d91631f6
|
|
@ -187,31 +187,23 @@ class ProgressPlugin {
|
|||
};
|
||||
const numberOfHooks = Object.keys(hooks).length;
|
||||
Object.keys(hooks).forEach((name, idx) => {
|
||||
let pass = 0;
|
||||
const title = hooks[name];
|
||||
const percentage = idx / numberOfHooks * 0.25 + 0.7;
|
||||
compilation.hooks[name].intercept({
|
||||
name: "ProgressPlugin",
|
||||
context: true,
|
||||
call: () => {
|
||||
if(pass++ > 0)
|
||||
handler(percentage, title, `pass ${pass}`);
|
||||
else
|
||||
handler(percentage, title);
|
||||
handler(percentage, title);
|
||||
},
|
||||
tap: (context, tap) => {
|
||||
if(context) {
|
||||
context.reportProgress = (...args) => {
|
||||
if(pass > 1)
|
||||
handler(percentage, title, `pass ${pass}`, tap.name, ...args);
|
||||
else
|
||||
handler(percentage, title, tap.name, ...args);
|
||||
// p is percentage from 0 to 1
|
||||
// args is any number of messages in a hierarchical matter
|
||||
context.reportProgress = (p, ...args) => {
|
||||
handler(percentage, title, tap.name, ...args);
|
||||
};
|
||||
}
|
||||
if(pass > 1)
|
||||
handler(percentage, title, `pass ${pass}`, tap.name);
|
||||
else
|
||||
handler(percentage, title, tap.name);
|
||||
handler(percentage, title, tap.name);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -224,7 +216,7 @@ class ProgressPlugin {
|
|||
},
|
||||
tap: (context, tap) => {
|
||||
if(context) {
|
||||
context.reportProgress = (...args) => {
|
||||
context.reportProgress = (p, ...args) => {
|
||||
handler(0.95, "emitting", tap.name, ...args);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue