作者:我是你的鹏鹏鹏爷 | 来源:互联网 | 2023-02-05 14:23
我一直在浏览Visual Studio Code的文档,以弄清楚如何将多个连续任务添加到tasks.json
文件中.
该tasks
数组仅允许为同一命令创建不同的参数.在这个例子中命令是echo
.
{
"version": "0.1.0",
"command": "echo",
"isShellCommand": true,
"args": [],
"showOutput": "always",
"echoCommand": true,
"suppressTaskName": true,
"tasks": [
{
"taskName": "hello",
"args": ["Hello World"]
},
{
"taskName": "bye",
"args": ["Good Bye"]
}
]
}
tasks.json是否允许连续执行多个任务?例如,tsc
接下来是uglify
?
1> Ben Creasy..:
该dependsOn
功能在1.10.0版中提供.例如,我使用它来编译和运行TypeScript中的单个文件脚本:
{
"version": "2.0.0",
"tasks": [
{
"command": "tsc -p ${cwd}/2017-play",
"label": "tsc-compile",
"type": "shell"
},
{
"command": "node ${cwd}/2017-play/build/${fileBasenameNoExtension}.js",
"label": "node-exec",
"type": "shell",
"dependsOn": [
"tsc-compile"
],
"problemMatcher": []
}
]
}