-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
在vscode 中,第一次,debug的时候,onstart钩子没有触发,只有修改main.js 后 Hot Restart,然后才触发onstart钩子
{
entry: 'src/main/index.js',
onstart({ startup }) {
console.log('onstart')
// 修改 main 代码后自动重启
startup([
'.',
'--no-sandbox',
'--sourcemap',
// For Chrome devtools
'--remote-debugging-port=9222'
])
},
}
下面是我的 launch.json 配置
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/vite",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/vite.cmd"
},
"console": "integratedTerminal"
},
直接通过 npx vite 第一次启动是可以触发 onstart钩子的
Metadata
Metadata
Assignees
Labels
No labels