launch.json
项目根路径的.vscode文件件内的配置文件。
{
"version": "0.2.0",
"configurations": [
// {
// "name": "npm install",
// "type": "shell",
// "request": "attach",
// "processOd": "${coman:pickProcess}"
// },
{
"type": "node",
"request": "launch",
"name": "Lerna Debug",
"skipFiles": [
"<node_internals>/**"
],
// cwd 表示命令运行目录
"cwd": "${workspaceFolder}/lerna",
// program 代表将要执行的文件
"program": "${workspaceFolder}/lerna/core/lerna/cli.js",
// args 代表执行命令后面的参数
"args": [
"ls"
],
// 使用vscode的集成终端
"console": "integratedTerminal",
// 表示在执行当前debug之前要执行的命令
// "preLaunchTask": {
// "task": "get info",
// }
}
]
}
任务列表tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "get info",
"type": "shell",
"command": "npm",
"args": [
"info"
],
"group": "build"
}
]
}
常用操作
- step into 进入函数内部
- step out 退出函数
- step over 跳过函数