@@ -2,22 +2,22 @@ import { createRsbuild, loadConfig } from '@rsbuild/core'
2
2
import 'dotenv/config'
3
3
4
4
async function startServer ( ) {
5
- const config = await loadConfig ( )
6
- const rsbuild = await createRsbuild ( {
7
- rsbuildConfig : config . content ,
8
- } )
9
- const devServer = await rsbuild . createDevServer ( )
5
+ const config = await loadConfig ( )
6
+ const rsbuild = await createRsbuild ( {
7
+ rsbuildConfig : config . content ,
8
+ } )
9
+ const devServer = await rsbuild . createDevServer ( )
10
10
11
- // Load the bundle first to get createApp
12
- if ( ! devServer . environments ?. node ) {
13
- throw new Error ( 'Node environment not found in dev server' )
14
- }
11
+ // Load the bundle first to get createApp
12
+ if ( ! devServer . environments ?. node ) {
13
+ throw new Error ( 'Node environment not found in dev server' )
14
+ }
15
15
16
- const bundle = await devServer . environments . node . loadBundle ( 'app' )
17
- const { createApp } = bundle
18
- const app = await createApp ( devServer )
16
+ const bundle = await devServer . environments . node . loadBundle ( 'app' )
17
+ const { createApp } = bundle
18
+ const app = await createApp ( devServer )
19
19
20
- devServer . connectWebSocket ( { server : app } )
20
+ devServer . connectWebSocket ( { server : app } )
21
21
}
22
22
23
23
void startServer ( ) . catch ( console . error )
0 commit comments