File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import serveStatic from './serveStatic'
1414import inspectorHandler from './ws/inspector'
1515import passLogsHandler from './ws/passLogs'
1616
17- export async function createServer ( options : Options ) {
17+ export async function createServer ( options : Options , printInfoFn : ( ) => void ) {
1818 const { server, launchEditor, passLogs, inspector } = options
1919 const { port, host } = server !
2020 const specifiedEditor = typeof launchEditor === 'object' ? launchEditor . specifiedEditor : undefined
@@ -77,6 +77,7 @@ export async function createServer(options: Options) {
7777 options . server ! . port = currentPort
7878 globalStore . set ( 'port' , currentPort )
7979 env . UNPLUGIN_TURBO_CONSOLE_SERVER_PORT = currentPort . toString ( )
80+ printInfoFn ( )
8081 } )
8182
8283 server . listen ( currentPort )
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (rawOptions
2222 const serverState = globalStore . get < boolean > ( 'serverState' )
2323 if ( ! serverState ) {
2424 globalStore . set ( 'serverState' , true )
25- await createServer ( options )
26- printInfo ( options )
25+ await createServer ( options , ( ) => printInfo ( options ) )
2726 }
2827 }
2928
@@ -88,20 +87,20 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (rawOptions
8887 const serverState = globalStore . get < boolean > ( 'serverState' )
8988 if ( ! serverState ) {
9089 globalStore . set ( 'serverState' , true )
91- await createServer ( options )
90+ await createServer ( options , async ( ) => {
91+ const _print = server . printUrls
9292
93- const _print = server . printUrls
94-
95- const NuxtKit = await loadPkg ( '@nuxt/kit' )
96- if ( NuxtKit ) {
97- printInfo ( options , ' ' )
98- }
99- else {
100- server . printUrls = ( ) => {
101- _print ( )
102- printInfo ( options )
93+ const NuxtKit = await loadPkg ( '@nuxt/kit' )
94+ if ( NuxtKit ) {
95+ printInfo ( options , ' ' )
10396 }
104- }
97+ else {
98+ server . printUrls = ( ) => {
99+ _print ( )
100+ printInfo ( options )
101+ }
102+ }
103+ } )
105104 }
106105 } ,
107106 } ,
You can’t perform that action at this time.
0 commit comments