File tree 2 files changed +11
-8
lines changed
2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -87,17 +87,19 @@ export async function getProgressBarPlugin({
87
87
currentBundler : CurrentBundler ;
88
88
} ) : Promise < typeof WebpackBar > {
89
89
if ( currentBundler . name === 'rspack' ) {
90
- class CustomRspackProgressPlugin extends currentBundler . instance
91
- . ProgressPlugin {
92
- constructor ( { name} : { name : string } ) {
93
- // TODO add support for color
94
- // Unfortunately the rspack.ProgressPlugin does not have a name option
90
+ const rspack = getCurrentBundlerAsRspack ( { currentBundler} ) ;
91
+ class CustomRspackProgressPlugin extends rspack . ProgressPlugin {
92
+ constructor ( { name, color = 'green' } : { name ?: string ; color ?: string } ) {
93
+ // Unfortunately rspack.ProgressPlugin does not have name/color options
95
94
// See https://rspack.dev/plugins/webpack/progress-plugin
96
- // @ts -expect-error: adapt Rspack ProgressPlugin constructor
97
- super ( { prefix : name } ) ;
95
+ super ( {
96
+ prefix : name ,
97
+ template : `● {prefix:.bold} {bar:50.${ color } /white.dim} ({percent}%) {wide_msg:.dim}` ,
98
+ progressChars : '■■' ,
99
+ } ) ;
98
100
}
99
101
}
100
- return CustomRspackProgressPlugin as typeof WebpackBar ;
102
+ return CustomRspackProgressPlugin as unknown as typeof WebpackBar ;
101
103
}
102
104
103
105
return WebpackBar ;
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ async function createBaseClientConfig({
65
65
new ChunkAssetPlugin ( ) ,
66
66
new ProgressBarPlugin ( {
67
67
name : 'Client' ,
68
+ color : 'green' ,
68
69
} ) ,
69
70
await createStaticDirectoriesCopyPlugin ( {
70
71
props,
You can’t perform that action at this time.
0 commit comments