为什么多个js只能运行一个_快速运行一个或多个NPM指令

快速运行单个:直接点击就好了。里面都是当前文件夹的package.json中声明好的指令

0a28a25b4e4a42723bb5822c9c58a711.png

多个:

1:clat+alt +p 输入 run task --> 任务 运行任务 --> 选择你要运行的任务 -->重复前面的操作

436e3bec481c54bba4492f66759e6ea8.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

{
// 使用 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"
}
]
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值