Skip to content

Commit 4ff49f1

Browse files
committed
noop ProgressPlugin when running CI
1 parent af5957c commit 4ff49f1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

packages/react-dev-utils/BuildProgressPlugin.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,26 @@ const ProgressBar = require('progress');
77
const chalk = require('chalk');
88

99
function BuildProgressPlugin() {
10+
if (process.env.CI) {
11+
return new ProgressPlugin(function handler(percentage, msg) {
12+
// noop
13+
})
14+
}
1015
const bar = new ProgressBar(` [:bar] ${ chalk.bold(':percent') } ${ chalk.yellow(':etas') } (${ chalk.dim(':msg') })`, {
1116
total: 100,
1217
complete: '=',
1318
incomplete: ' ',
1419
width: 25
1520
});
16-
return new ProgressPlugin(function (percent, msg) {
17-
if (percent === 1) msg = 'completed';
21+
return new ProgressPlugin(function handler(percent, msg) {
22+
const done = percent === 1;
23+
if (done) {
24+
msg = 'completed';
25+
}
1826
bar.update(percent, { msg });
19-
if (percent === 1) bar.terminate();
27+
if (done) {
28+
bar.terminate();
29+
}
2030
});
2131
}
2232

0 commit comments

Comments
 (0)