File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { type RsbuildInstance, createRsbuild } from '@rsbuild/core';
22import { composeRsbuildEnvironments , pruneEnvironments } from '../config' ;
33import type { RslibConfig } from '../types/config' ;
44import type { BuildOptions } from './commands' ;
5- import { onBeforeRestartServer } from './restart' ;
5+ import { onBeforeRestart } from './restart' ;
66
77export async function build (
88 config : RslibConfig ,
@@ -20,7 +20,7 @@ export async function build(
2020 } ) ;
2121
2222 if ( options . watch ) {
23- onBeforeRestartServer ( buildInstance . close ) ;
23+ onBeforeRestart ( buildInstance . close ) ;
2424 } else {
2525 await buildInstance . close ( ) ;
2626 }
Original file line number Diff line number Diff line change @@ -118,18 +118,18 @@ export function runCli(): void {
118118 . description ( 'start Rsbuild dev server of Module Federation format' )
119119 . action ( async ( options : CommonOptions ) => {
120120 try {
121- const mfDev = async ( ) => {
121+ const cliMfDev = async ( ) => {
122122 const { content : rslibConfig , filePath } =
123123 await loadRslibConfig ( options ) ;
124124 // TODO: support lib option in mf dev server
125125 await startMFDevServer ( rslibConfig ) ;
126126
127127 watchFilesForRestart ( [ filePath ] , async ( ) => {
128- await mfDev ( ) ;
128+ await cliMfDev ( ) ;
129129 } ) ;
130130 } ;
131131
132- await mfDev ( ) ;
132+ await cliMfDev ( ) ;
133133 } catch ( err ) {
134134 logger . error ( 'Failed to start mf dev.' ) ;
135135 logger . error ( err ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { createRsbuild, mergeRsbuildConfig } from '@rsbuild/core';
22import type { RsbuildConfig , RsbuildInstance } from '@rsbuild/core' ;
33import { composeCreateRsbuildConfig } from '../config' ;
44import type { RslibConfig } from '../types' ;
5- import { onBeforeRestartServer } from './restart' ;
5+ import { onBeforeRestart } from './restart' ;
66
77export async function startMFDevServer (
88 config : RslibConfig ,
@@ -30,7 +30,7 @@ async function initMFRsbuild(
3030 } ) ;
3131 const devServer = await rsbuildInstance . startDevServer ( ) ;
3232
33- onBeforeRestartServer ( devServer . server . close ) ;
33+ onBeforeRestart ( devServer . server . close ) ;
3434 return rsbuildInstance ;
3535}
3636
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ let cleaners: Cleaner[] = [];
4141/**
4242 * Add a cleaner to handle side effects
4343 */
44- export const onBeforeRestartServer = ( cleaner : Cleaner ) : void => {
44+ export const onBeforeRestart = ( cleaner : Cleaner ) : void => {
4545 cleaners . push ( cleaner ) ;
4646} ;
4747
You can’t perform that action at this time.
0 commit comments