【发布时间】:2016-12-07 16:36:45
【问题描述】:
是否有人有一个launch.json 示例,可用于Visual Studio Code 附加或启动NW.JS 桌面程序。是的,我知道 NW.JS 使用 chromium 调试,你可以直接这样调试。但如果能够从 VS CODE 进行调试和单步运行,那就太好了。
我假设它使用端口 9222(下面不起作用)
{
"version": "0.2.0",
"configurations": [
{
"name": "DOM Debug",
"type": "chrome",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/nw.exe",
"runtimeArgs": [
"${workspaceRoot}",
"--remote-debugging-port=9222"
],
"webRoot": "${workspaceRoot}",
"sourceMaps": false,
"diagnosticLogging": true,
"port": 9222
},
{
"name": "Node Debug",
"type": "chrome",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/nw.exe",
"runtimeArgs": [
"${workspaceRoot}",
"--remote-debugging-port=9222"
],
"url": "chrome-extension://*/_generated_background_page.html",
"webRoot": "${workspaceRoot}",
"sourceMaps": false,
"diagnosticLogging": true,
"port": 9222
}
]
}
下面附上日志:
【问题讨论】: