From aa91ce76a5f4e0e6fdd3f6819ee73e6cb5b498c2 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 12 Apr 2023 15:03:04 +0800 Subject: [PATCH] fix(progress): should not display empty progress bar (#2725) --- .changeset/shiny-squids-matter.md | 5 +++++ crates/rspack_plugin_progress/src/lib.rs | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .changeset/shiny-squids-matter.md diff --git a/.changeset/shiny-squids-matter.md b/.changeset/shiny-squids-matter.md new file mode 100644 index 00000000000..aa2bd0bad40 --- /dev/null +++ b/.changeset/shiny-squids-matter.md @@ -0,0 +1,5 @@ +--- +"@rspack/binding": patch +--- + +fix(progress): should not display empty progress bar diff --git a/crates/rspack_plugin_progress/src/lib.rs b/crates/rspack_plugin_progress/src/lib.rs index 5c97eb3a82b..2a950862321 100644 --- a/crates/rspack_plugin_progress/src/lib.rs +++ b/crates/rspack_plugin_progress/src/lib.rs @@ -31,12 +31,6 @@ impl ProgressPlugin { ProgressStyle::with_template("{prefix} {bar:40.cyan/blue} {percent}% {wide_msg}") .expect("TODO:"), ); - progress_bar.set_prefix( - options - .prefix - .clone() - .unwrap_or_else(|| "Rspack".to_string()), - ); Self { options, progress_bar, @@ -55,6 +49,13 @@ impl Plugin for ProgressPlugin { async fn make(&self, _ctx: PluginContext, _compilation: &Compilation) -> PluginMakeHookOutput { self.progress_bar.reset(); + self.progress_bar.set_prefix( + self + .options + .prefix + .clone() + .unwrap_or_else(|| "Rspack".to_string()), + ); self.modules_count.store(0, SeqCst); self.modules_done.store(0, SeqCst); self.progress_bar.set_message("make");