mirror of
https://github.com/alex8088/electron-vite.git
synced 2025-04-06 04:05:44 +08:00
fix: output duplicate log in vscode debugging #75
This commit is contained in:
parent
a5de5b36f5
commit
f7b4146c56
@ -110,12 +110,14 @@ export function startElectron(root: string | undefined, logger: Logger): ChildPr
|
||||
|
||||
const electronPath = getElectronPath()
|
||||
|
||||
const inspect = !!process.env.VSCODE_INSPECTOR_OPTIONS
|
||||
|
||||
const ps = spawn(electronPath, ['.'])
|
||||
ps.stdout.on('data', chunk => {
|
||||
chunk.toString().trim() && logger.info(chunk.toString())
|
||||
!inspect && chunk.toString().trim() && logger.info(chunk.toString())
|
||||
})
|
||||
ps.stderr.on('data', chunk => {
|
||||
chunk.toString().trim() && logger.error(chunk.toString())
|
||||
!inspect && chunk.toString().trim() && logger.error(chunk.toString())
|
||||
})
|
||||
ps.on('close', process.exit)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user