@@ -78,13 +78,10 @@ use rspack_plugin_mf::{
78
78
use rspack_plugin_module_info_header:: ModuleInfoHeaderPlugin ;
79
79
use rspack_plugin_module_replacement:: { ContextReplacementPlugin , NormalModuleReplacementPlugin } ;
80
80
use rspack_plugin_no_emit_on_errors:: NoEmitOnErrorsPlugin ;
81
- use rspack_plugin_progress:: ProgressPlugin ;
82
81
use rspack_plugin_real_content_hash:: RealContentHashPlugin ;
83
82
use rspack_plugin_remove_duplicate_modules:: RemoveDuplicateModulesPlugin ;
84
83
use rspack_plugin_remove_empty_chunks:: RemoveEmptyChunksPlugin ;
85
- use rspack_plugin_rsdoctor:: RsdoctorPlugin ;
86
84
use rspack_plugin_rslib:: RslibPlugin ;
87
- use rspack_plugin_rstest:: RstestPlugin ;
88
85
use rspack_plugin_runtime:: {
89
86
ArrayPushCallbackChunkFormatPlugin , BundlerInfoPlugin , ChunkPrefetchPreloadPlugin ,
90
87
CommonJsChunkFormatPlugin , ModuleChunkFormatPlugin , RuntimePlugin , enable_chunk_loading_plugin,
@@ -120,7 +117,6 @@ use self::{
120
117
RawProvideOptions ,
121
118
} ,
122
119
raw_normal_replacement:: RawNormalModuleReplacementPluginOptions ,
123
- raw_progress:: RawProgressPluginOptions ,
124
120
raw_runtime_chunk:: RawRuntimeChunkOptions ,
125
121
raw_size_limits:: RawSizeLimitsPluginOptions ,
126
122
raw_swc_js_minimizer:: RawSwcJsMinimizerRspackPluginOptions ,
@@ -133,9 +129,7 @@ use crate::{
133
129
RawExternalsPluginOptions , RawHttpExternalsRspackPluginOptions , RawSplitChunksOptions ,
134
130
SourceMapDevToolPluginOptions ,
135
131
} ,
136
- rsdoctor:: RawRsdoctorPluginOptions ,
137
132
rslib:: RawRslibPluginOptions ,
138
- rstest:: RawRstestPluginOptions ,
139
133
} ;
140
134
141
135
#[ napi( string_enum) ]
@@ -329,13 +323,20 @@ impl<'a> BuiltinPlugin<'a> {
329
323
plugins. push ( plugin) ;
330
324
}
331
325
BuiltinPluginName :: ProgressPlugin => {
332
- let plugin = ProgressPlugin :: new (
333
- downcast_into :: < RawProgressPluginOptions > ( self . options )
334
- . map_err ( |report| napi:: Error :: from_reason ( report. to_string ( ) ) ) ?
335
- . into ( ) ,
336
- )
337
- . boxed ( ) ;
338
- plugins. push ( plugin) ;
326
+ #[ cfg( not( feature = "browser" ) ) ]
327
+ {
328
+ use rspack_plugin_progress:: ProgressPlugin ;
329
+
330
+ use crate :: raw_options:: raw_builtins:: raw_progress:: RawProgressPluginOptions ;
331
+
332
+ let plugin = ProgressPlugin :: new (
333
+ downcast_into :: < RawProgressPluginOptions > ( self . options )
334
+ . map_err ( |report| napi:: Error :: from_reason ( report. to_string ( ) ) ) ?
335
+ . into ( ) ,
336
+ )
337
+ . boxed ( ) ;
338
+ plugins. push ( plugin) ;
339
+ }
339
340
}
340
341
BuiltinPluginName :: EntryPlugin => {
341
342
let plugin_options = downcast_into :: < JsEntryPluginOptions > ( self . options )
@@ -769,16 +770,30 @@ impl<'a> BuiltinPlugin<'a> {
769
770
plugins. push ( DllReferenceAgencyPlugin :: new ( options) . boxed ( ) ) ;
770
771
}
771
772
BuiltinPluginName :: RsdoctorPlugin => {
772
- let raw_options = downcast_into :: < RawRsdoctorPluginOptions > ( self . options )
773
- . map_err ( |report| napi:: Error :: from_reason ( report. to_string ( ) ) ) ?;
774
- let options = raw_options. into ( ) ;
775
- plugins. push ( RsdoctorPlugin :: new ( options) . boxed ( ) ) ;
773
+ #[ cfg( not( feature = "browser" ) ) ]
774
+ {
775
+ use rspack_plugin_rsdoctor:: RsdoctorPlugin ;
776
+
777
+ use crate :: rsdoctor:: RawRsdoctorPluginOptions ;
778
+
779
+ let raw_options = downcast_into :: < RawRsdoctorPluginOptions > ( self . options )
780
+ . map_err ( |report| napi:: Error :: from_reason ( report. to_string ( ) ) ) ?;
781
+ let options = raw_options. into ( ) ;
782
+ plugins. push ( RsdoctorPlugin :: new ( options) . boxed ( ) ) ;
783
+ }
776
784
}
777
785
BuiltinPluginName :: RstestPlugin => {
778
- let raw_options = downcast_into :: < RawRstestPluginOptions > ( self . options )
779
- . map_err ( |report| napi:: Error :: from_reason ( report. to_string ( ) ) ) ?;
780
- let options = raw_options. into ( ) ;
781
- plugins. push ( RstestPlugin :: new ( options) . boxed ( ) ) ;
786
+ #[ cfg( not( feature = "browser" ) ) ]
787
+ {
788
+ use rspack_plugin_rstest:: RstestPlugin ;
789
+
790
+ use crate :: rstest:: RawRstestPluginOptions ;
791
+
792
+ let raw_options = downcast_into :: < RawRstestPluginOptions > ( self . options )
793
+ . map_err ( |report| napi:: Error :: from_reason ( report. to_string ( ) ) ) ?;
794
+ let options = raw_options. into ( ) ;
795
+ plugins. push ( RstestPlugin :: new ( options) . boxed ( ) ) ;
796
+ }
782
797
}
783
798
BuiltinPluginName :: RslibPlugin => {
784
799
let raw_options = downcast_into :: < RawRslibPluginOptions > ( self . options )
0 commit comments