如何在给启动的时候加上 --sourcemap --remote-debugging-port=9222 参数呢,想要调试主进程。或者如何开一个端口调试 然后从chrome devtools里调试呢
qiming97 opened this issue · comments
qiming97 commented
Describe the problem you confuse
如何在给启动的时候加上 --sourcemap --remote-debugging-port=9222 参数呢,想要调试主进程。或者如何开一个端口调试 然后从chrome devtools里调试呢
Leo Wang(草鞋没号) commented
https://electron-vite.github.io/faq/debug.html
// vite.config.ts
import electron from 'vite-plugin-electron'
export default {
plugins: [
electron({
entry: 'electron/main/index.ts',
onstart({ startup }) {
startup([
'.',
'--no-sandbox',
'--sourcemap',
// For Chrome devtools
'--remote-debugging-port=9222',
])
},
}),
],
}
Zeo Kin commented
// vite.config.ts
import electron from 'vite-plugin-electron'
export default {
plugins: [
electron({
entry: 'electron/main/index.ts',
onstart({ startup }) {
startup([
'.',
'--no-sandbox',
'--sourcemap',
// For Chrome devtools
'--remote-debugging-port=9222', // for renderer process
+ '--inspect=9228', // for main process
])
},
}),
],
}