Skip to content

Commit 2862002

Browse files
author
Pooya Parsa
committed
feat: show inactive parallel tasks
1 parent 9e5d7d3 commit 2862002

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/index.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
9090
if (this.options.minimal) {
9191
this.options.stream.write(`Compiling ${this.options.name}\n`);
9292
}
93-
delete this.state.time;
9493
} else if (wasRunning && !isRunning) {
9594
// Finished
9695
const time = process.hrtime(this.state.start);
@@ -131,14 +130,14 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
131130
return;
132131
}
133132

134-
const stateLines = _.sortBy(Object.keys(sharedState), (n) => n)
135-
.filter((s) => sharedState[s].isRunning || sharedState[s].start)
136-
.map((name) => {
133+
const stateLines = _.sortBy(Object.keys(sharedState), (n) => n).map(
134+
(name) => {
137135
const state = sharedState[name];
138136
const color = colorize(state.color);
139137

140138
if (!state.isRunning) {
141-
return `${[chalk.grey(BULLET), name].join(' ')}`;
139+
const color2 = state.progress === 100 ? color : chalk.grey;
140+
return color2(`${BULLET} ${name}\n`);
142141
}
143142

144143
return `${[
@@ -150,10 +149,10 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
150149
chalk.grey((state.details && state.details[0]) || ''),
151150
chalk.grey((state.details && state.details[1]) || ''),
152151
].join(' ')}\n ${state.request ? formatRequest(state.request) : ''}\n`;
153-
})
154-
.filter(Boolean);
152+
}
153+
);
155154

156-
if (stateLines.length) {
155+
if (hasRunning()) {
157156
const title = chalk.underline.blue('Compiling');
158157
const log = `\n${title}\n\n${stateLines.join('\n')}`;
159158
this.logUpdate(log);

0 commit comments

Comments
 (0)