File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ interface DevCLIOptions {
3232 inspect ?: boolean | string
3333 inspectBrk ?: boolean | string
3434 remoteDebuggingPort ?: string
35+ noElectronStart ?: boolean
3536 noSandbox ?: boolean
3637 rendererOnly ?: boolean
3738}
7879 . option ( '--inspect [port]' , `[boolean | number] enable V8 inspector on the specified port` )
7980 . option ( '--inspectBrk [port]' , `[boolean | number] enable V8 inspector on the specified port` )
8081 . option ( '--remoteDebuggingPort <port>' , `[string] port for remote debugging` )
82+ . option ( '--noElectronStart' , `[boolean] run dev servers without starting the Electron app` )
8183 . option ( '--noSandbox' , `[boolean] forces renderer process to run un-sandboxed` )
8284 . option ( '--rendererOnly' , `[boolean] only dev server for the renderer` )
8385 . action ( async ( root : string , options : DevCLIOptions & GlobalCLIOptions ) => {
109111 const inlineConfig = createInlineConfig ( root , options )
110112
111113 try {
112- await createServer ( inlineConfig , { rendererOnly : options . rendererOnly } )
114+ await createServer ( inlineConfig , { rendererOnly : options . rendererOnly , noElectronStart : options . noElectronStart } )
113115 } catch ( e ) {
114116 const error = e as Error
115117 createLogger ( options . logLevel ) . error (
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { startElectron } from './electron'
1414
1515export async function createServer (
1616 inlineConfig : InlineConfig = { } ,
17- options : { rendererOnly ?: boolean }
17+ options : { rendererOnly ?: boolean ; noElectronStart ?: boolean }
1818) : Promise < void > {
1919 process . env . NODE_ENV_ELECTRON_VITE = 'development'
2020 const config = await resolveConfig ( inlineConfig , 'serve' , 'development' )
@@ -104,9 +104,11 @@ export async function createServer(
104104 server . printUrls ( )
105105 }
106106
107- ps = startElectron ( inlineConfig . root )
107+ if ( ! options . noElectronStart ) {
108+ ps = startElectron ( inlineConfig . root )
108109
109- logger . info ( colors . green ( `\nstart electron app...\n` ) )
110+ logger . info ( colors . green ( `\nstart electron app...\n` ) )
111+ }
110112 }
111113}
112114
You can’t perform that action at this time.
0 commit comments