通过此设置,我可以远程调试js文件(在我的Raspberry Pi上)。 但我想打破ts文件,正如我在本地调试时能做的那样。这可能吗?
我尝试在launch.json中使用不同的参数,但没有运气。 sourceMaps和outFiles似乎没有任何效果。
launch.json
{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "192.168.0.222",
"port": 9229,
"protocol": "inspector",
"localRoot": "${workspaceFolder}/src",
"remoteRoot": "/home/pi/BADGER/src",
"outFiles": [
"${workspaceFolder}/bin/**/*.js"
],
"sourceMaps": true
}
答案 0 :(得分:0)
基于这篇文章:Debugging TypeScript in VS Code without compiling, using ts-node
再次 - 鉴于您的节点应用程序在http://192.168.0.222:9229上运行(尝试手动输入此路径以进行验证)
将此添加到launch.json
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 9229,
"address": "192.168.0.222",
"restart": true,
"sourceMaps": true,
"outDir": "${workspaceRoot}",
"localRoot": "${workspaceRoot}",
"remoteRoot": "/home/pi/BADGER/src"
}