Skip to content

Commit b59c1d4

Browse files
committed
fix: set overlay.warning is false when use cli server
1 parent 974f8fe commit b59c1d4

File tree

1 file changed

+24
-0
lines changed
  • packages/rspack-cli/src/commands

1 file changed

+24
-0
lines changed

packages/rspack-cli/src/commands/serve.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)