Visual studio code 如何使VS代码复合调试器在默认情况下运行?
我有以下Visual studio code 如何使VS代码复合调试器在默认情况下运行?,visual-studio-code,vscode-settings,vscode-debugger,Visual Studio Code,Vscode Settings,Vscode Debugger,我有以下.vscode/launch.json配置: { "version": "0.2.0", "configurations": [ { "type": "chrome", "request": "launch", "name": "Next: Chrome", "url": "localhost:3000", "webRoot": "${workspaceFolder}/src" }, {
.vscode/launch.json
配置:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Next: Chrome",
"url": "localhost:3000",
"webRoot": "${workspaceFolder}/src"
},
{
"type": "node",
"request": "launch",
"name": "Next: Node",
"runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next",
"port": 9229,
"env": {
"NODE_OPTIONS": "--inspect"
}
}
],
"compounds": [
{
"name": "Next: Full",
"configurations": ["Next: Node", "Next: Chrome"]
}
]
}
通过使用F5启动调试器,我希望它运行Next:Full
命令。但是它运行的是Next:Chrome
,因此看起来好像有些东西不工作,但您必须手动更改它,然后重新运行:
那就行了。但是可以在配置中将其设置为默认值吗?可以通过在列表的第一个
配置中添加其他有用的条目,使用相同的名称(类型和请求也是必需的):
它被证明是一个别名:
可以在列表的第一个配置中添加其他有用的条目,并使用相同的名称(类型和请求也是必需的):
它被证明是一个别名:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "Next: Full",
"request": "launch"
},
{
"type": "chrome",
"request": "launch",
"name": "Next: Chrome",
"url": "localhost:3000",
"webRoot": "${workspaceFolder}/src"
},
{
"type": "node",
"request": "launch",
"name": "Next: Node",
"runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next",
"port": 9229,
"env": {
"NODE_OPTIONS": "--inspect"
}
}
],
"compounds": [
{
"name": "Next: Full",
"configurations": ["Next: Node", "Next: Chrome"]
}
]
}