我很难配置vs代码来调试电子应用程序。
我想要做的是使用-d
选项构建项目以生成调试(https://quasar.dev/quasar-cli/cli-documentation/commands-list#build)
然后使用以下vscode启动配置:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"name": "Electron Main",
// "preLaunchTask": "npm: quasar build -m electron",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args" : ["."],
"outputCapture": "std",
"program": "${workspaceFolder}/dist/electron/UnPackaged/electron-main.js"
}
]
}
这不起作用。程序启动,但是每个断点都“未验证”,并且未命中。据我所知,可能是因为类星体使用babel来转译文件之类的东西。我想我缺少一些配置。有什么想法可以调试吗?