File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
packages/rspack-cli/src/commands Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,37 @@ export class ServeCommand implements RspackCommand {
4343 for ( const compiler of compilers ) {
4444 const devServer = ( compiler . options . devServer ??= { } ) ;
4545 devServer . hot ??= true ;
46+ if ( devServer . client !== false ) {
47+ if ( devServer . client === true || devServer . client == null ) {
48+ devServer . client = { } ;
49+ }
50+ devServer . client = {
51+ overlay : {
52+ errors : true ,
53+ warnings : false
54+ } ,
55+ ...devServer . client
56+ } ;
57+ }
4658 }
4759
4860 const result = ( compilerForDevServer . options . devServer ??= { } ) ;
4961 /**
5062 * Enable this to tell Rspack that we need to enable React Refresh by default
5163 */
5264 result . hot ??= true ;
65+ if ( result . client !== false ) {
66+ if ( result . client === true || result . client == null ) {
67+ result . client = { } ;
68+ }
69+ result . client = {
70+ overlay : {
71+ errors : true ,
72+ warnings : false
73+ } ,
74+ ...result . client
75+ } ;
76+ }
5377
5478 const devServerOptions = result as DevServer ;
5579 if ( devServerOptions . port ) {
You can’t perform that action at this time.
0 commit comments