快速运行单个:直接点击就好了。里面都是当前文件夹的package.json中声明好的指令
![0a28a25b4e4a42723bb5822c9c58a711.png](https://i-blog.csdnimg.cn/blog_migrate/084df585fa48691f4b6313623155481c.png)
多个:
1:clat+alt +p 输入 run task --> 任务 运行任务 --> 选择你要运行的任务 -->重复前面的操作
![436e3bec481c54bba4492f66759e6ea8.png](https://i-blog.csdnimg.cn/blog_migrate/f7d6563f6f966c46bb533ed896b8acd3.png)
2:出现.vscode 文件夹和 tasks.json文件
{
// 有关 tasks.json 格式的文档,请参见
// https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"label": "super-testing", // 运行时名称
"type": "npm", // 指令类型
"script": "testing", // 指令 等同 npm run testing
"path": "miaotaoyun-super/", // 文件
"problemMatcher": [] // 不知道
},
{
"label": "h5-testing",
"type": "npm",
"script": "testing",
"path": "miaotaoyun_h5/",
"problemMatcher": []
},
{
"label": "partner-testing",
"type": "npm",
"script": "testing",
"path": "miaotaoyun-partner-admin/",
"problemMatcher": []
},
{
"label": "h5-build",
"type": "npm",
"script": "build",
"path": "miaotaoyun_h5/",
"group": "build",
"problemMatcher": []
},
{
"label": "super-build",
"type": "npm",
"script": "build",
"path": "miaotaoyun-super/",
"group": "build",
"problemMatcher": []
},
{
"label": "partner-build",
"type": "npm",
"script": "build",
"path": "miaotaoyun-partner-admin/",
"group": "build",
"problemMatcher": []
},
{
"label": "Testing Both",
"dependsOn": [ // 运行多个声明的东东
"super-testing",
"h5-testing",
"partner-testing"
],
"group": { // 不知道
"kind": "build",
"isDefault": true
}
},
{
"label": "Build Both",
"dependsOn": [
"h5-build",
"super-build",
"partner-build"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
3:调式-->设置-->选择NODE--> .vscode目录下出现 lauch.json文件-->配置-->调试启动即可
![867255efd84223fabd8b29e9bf155b94.png](https://i-blog.csdnimg.cn/blog_migrate/95d9a75cd031cabf4c2700458c25ba12.jpeg)
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "测试", // 名称而已
"preLaunchTask": "Testing Both" // tasks,中某一个声明的label
},
{
"type": "node",
"request": "launch",
"name": "线上",
"preLaunchTask": "Build Both"
}
]
}