VScode launch调试文件

创建launch.json文件

.vscode文件下创建launch.json文件

configurations里面进行配置,每一个{}对象对应一个调试任务

右下角可以快捷添加配置模板

把鼠标悬停在key上,会出现提示

完整配置Hexo的调试文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Hexo Server",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"server"
],
"cwd": "${workspaceFolder}",
"outputCapture": "std"
},
{
"type": "node",
"request": "launch",
"name": "Build Hexo Site",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"build"
],
"cwd": "${workspaceFolder}",
"outputCapture": "std"
},
{
"type": "node",
"request": "launch",
"name": "Deploy Hexo Site",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"deploy"
],
"cwd": "${workspaceFolder}",
"outputCapture": "std"
},
{
"type": "node",
"request": "launch",
"name": "Clean Hexo Site",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"clean"
],
"cwd": "${workspaceFolder}",
"outputCapture": "std"
}
]
}