@@ -78,13 +78,10 @@ use rspack_plugin_mf::{
7878use rspack_plugin_module_info_header:: ModuleInfoHeaderPlugin ;
7979use rspack_plugin_module_replacement:: { ContextReplacementPlugin , NormalModuleReplacementPlugin } ;
8080use rspack_plugin_no_emit_on_errors:: NoEmitOnErrorsPlugin ;
81- use rspack_plugin_progress:: ProgressPlugin ;
8281use rspack_plugin_real_content_hash:: RealContentHashPlugin ;
8382use rspack_plugin_remove_duplicate_modules:: RemoveDuplicateModulesPlugin ;
8483use rspack_plugin_remove_empty_chunks:: RemoveEmptyChunksPlugin ;
85- use rspack_plugin_rsdoctor:: RsdoctorPlugin ;
8684use rspack_plugin_rslib:: RslibPlugin ;
87- use rspack_plugin_rstest:: RstestPlugin ;
8885use rspack_plugin_runtime:: {
8986 ArrayPushCallbackChunkFormatPlugin , BundlerInfoPlugin , ChunkPrefetchPreloadPlugin ,
9087 CommonJsChunkFormatPlugin , ModuleChunkFormatPlugin , RuntimePlugin , enable_chunk_loading_plugin,
@@ -120,7 +117,6 @@ use self::{
120117 RawProvideOptions ,
121118 } ,
122119 raw_normal_replacement:: RawNormalModuleReplacementPluginOptions ,
123- raw_progress:: RawProgressPluginOptions ,
124120 raw_runtime_chunk:: RawRuntimeChunkOptions ,
125121 raw_size_limits:: RawSizeLimitsPluginOptions ,
126122 raw_swc_js_minimizer:: RawSwcJsMinimizerRspackPluginOptions ,
@@ -133,9 +129,7 @@ use crate::{
133129 RawExternalsPluginOptions , RawHttpExternalsRspackPluginOptions , RawSplitChunksOptions ,
134130 SourceMapDevToolPluginOptions ,
135131 } ,
136- rsdoctor:: RawRsdoctorPluginOptions ,
137132 rslib:: RawRslibPluginOptions ,
138- rstest:: RawRstestPluginOptions ,
139133} ;
140134
141135#[ napi( string_enum) ]
@@ -329,13 +323,20 @@ impl<'a> BuiltinPlugin<'a> {
329323 plugins. push ( plugin) ;
330324 }
331325 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+ }
339340 }
340341 BuiltinPluginName :: EntryPlugin => {
341342 let plugin_options = downcast_into :: < JsEntryPluginOptions > ( self . options )
@@ -769,16 +770,30 @@ impl<'a> BuiltinPlugin<'a> {
769770 plugins. push ( DllReferenceAgencyPlugin :: new ( options) . boxed ( ) ) ;
770771 }
771772 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+ }
776784 }
777785 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+ }
782797 }
783798 BuiltinPluginName :: RslibPlugin => {
784799 let raw_options = downcast_into :: < RawRslibPluginOptions > ( self . options )
0 commit comments