Skip to content

Commit

Permalink
feat: show inactive parallel tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Mar 31, 2018
1 parent 9e5d7d3 commit 2862002
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
if (this.options.minimal) {
this.options.stream.write(`Compiling ${this.options.name}\n`);
}
delete this.state.time;
} else if (wasRunning && !isRunning) {
// Finished
const time = process.hrtime(this.state.start);
Expand Down Expand Up @@ -131,14 +130,14 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
return;
}

const stateLines = _.sortBy(Object.keys(sharedState), (n) => n)
.filter((s) => sharedState[s].isRunning || sharedState[s].start)
.map((name) => {
const stateLines = _.sortBy(Object.keys(sharedState), (n) => n).map(
(name) => {
const state = sharedState[name];
const color = colorize(state.color);

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

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

if (stateLines.length) {
if (hasRunning()) {
const title = chalk.underline.blue('Compiling');
const log = `\n${title}\n\n${stateLines.join('\n')}`;
this.logUpdate(log);
Expand Down

0 comments on commit 2862002

Please sign in to comment.