Skip to content

Commit

Permalink
fix(progress): should not display empty progress bar (#2725)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Apr 12, 2023
1 parent b96a113 commit aa91ce7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-squids-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rspack/binding": patch
---

fix(progress): should not display empty progress bar
13 changes: 7 additions & 6 deletions crates/rspack_plugin_progress/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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");
Expand Down

0 comments on commit aa91ce7

Please sign in to comment.