Skip to content

Commit cc52e54

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular-devkit/build-angular): remove duplicate application bundle generation complete message
In some scenarios in Webpack 5 percentage goes from 1 back to 0.99, ex: 0.99 -> 1 -> 0.99 -> 1. This causes the "complete" message to be displayed multiple times.
1 parent 1f662eb commit cc52e54

File tree

1 file changed

+11
-0
lines changed
  • packages/angular_devkit/build_angular/src/webpack/configs

1 file changed

+11
-0
lines changed

packages/angular_devkit/build_angular/src/webpack/configs/common.ts

+11
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,17 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
228228
if (buildOptions.progress) {
229229
const spinner = new Spinner();
230230

231+
let previousPercentage: number | undefined;
231232
extraPlugins.push(new ProgressPlugin({
232233
handler: (percentage: number, message: string) => {
234+
if (previousPercentage === 1 && percentage !== 0) {
235+
// In some scenarios in Webpack 5 percentage goes from 1 back to 0.99.
236+
// Ex: 0.99 -> 1 -> 0.99 -> 1
237+
// This causes the "complete" message to be displayed multiple times.
238+
239+
return;
240+
}
241+
233242
switch (percentage) {
234243
case 0:
235244
spinner.start(`Generating ${platform} application bundles...`);
@@ -241,6 +250,8 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
241250
spinner.text = `Generating ${platform} application bundles (phase: ${message})...`;
242251
break;
243252
}
253+
254+
previousPercentage = percentage;
244255
},
245256
}));
246257
}

0 commit comments

Comments
 (0)