|
1 | 1 | use std::cmp::Ordering; |
2 | 2 | use std::sync::atomic::Ordering::Relaxed; |
3 | | -use std::sync::{Arc, RwLock}; |
| 3 | +use std::sync::{Arc, LazyLock, RwLock}; |
4 | 4 | use std::time::{Duration, SystemTime, UNIX_EPOCH}; |
5 | 5 | use std::{cmp, sync::atomic::AtomicU32, time::Instant}; |
6 | 6 |
|
7 | 7 | use async_trait::async_trait; |
8 | | -use indicatif::{ProgressBar, ProgressDrawTarget, ProgressStyle}; |
| 8 | +use indicatif::{MultiProgress, ProgressBar, ProgressDrawTarget, ProgressStyle}; |
9 | 9 | use rspack_collections::IdentifierMap; |
10 | 10 | use rspack_core::{ |
11 | 11 | ApplyContext, BoxModule, Compilation, CompilationAfterOptimizeModules, |
@@ -41,6 +41,7 @@ impl std::fmt::Debug for ProgressPluginOptions { |
41 | 41 | } |
42 | 42 | } |
43 | 43 |
|
| 44 | +static MULTI_PROGRESS: LazyLock<MultiProgress> = LazyLock::new(MultiProgress::new); |
44 | 45 | #[derive(Debug, Default)] |
45 | 46 | pub struct ProgressPluginDisplayOptions { |
46 | 47 | // the prefix name of progress bar |
@@ -101,7 +102,7 @@ impl ProgressPlugin { |
101 | 102 | Some(progress_bar) |
102 | 103 | } |
103 | 104 | }; |
104 | | - |
| 105 | + let progress_bar = progress_bar.map(|x| MULTI_PROGRESS.add(x)); |
105 | 106 | Self::new_inner( |
106 | 107 | options, |
107 | 108 | progress_bar, |
|
0 commit comments