我真的迷失在这里,请帮助我理解这个配置,
launch.json
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/workspace/angular/app/main.ts",
我看到了“程序”属性的许多变体,我不知道这个属性的用途是什么。
这是它对我有用的唯一方式:
"program": "${workspaceRoot}/workspace/angular/node_modules/lite-server/bin/lite-server",
但它不会让我调试应用程序和浏览器打开 “http://localhost:3000”不是应用程序的完整地址
我看到的示例如下:
"program": "${workspaceRoot}/app/app.js",
"program": "${workspaceRoot}/app/app.ts",
但它永远不会运行,我得到“系统未定义”错误,main.ts需要包含哪些内容?
我甚至看到了:
“program”:“http://localhost/blabla/index.html”,
什么是正确的方式?
答案 0 :(得分:0)
您是否尝试过为vscode使用Chrome调试器扩展程序?
launch.json
{
"version": "0.1.0",
"configurations": [
{
"name": "Attach with sourcemaps",
"type": "chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true,
"url": "<url of the open browser tab, you wanna connect to"
},
{
"name": "Attach to url with files served from ./out",
"type": "chrome",
"request": "attach",
"port": 9222,
"url": "<url of the open browser tab, you wanna connect to",
"webRoot": "${workspaceRoot}/out"
}
]
}
chrome --remote-debugging-port=9222