现在我们在 Visual Studio Code 中使用 tasks.json 0.1.0 版本的任务。
导航到https://code.visualstudio.com/docs/editor/tasks表明 VS 代码将自动检测我的 gulp 文件中的所有任务。
我已经安装了各种扩展来尝试自动检测我的任务,但它们仍然没有被检测到。
在这一点上,我正在考虑创建一个新版本的 tasks.json 来处理我们所有的 gulp 任务。
我该怎么做呢?这是我的tasks.json 0.1.0:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "gulp",
"isShellCommand": true,
"args": [],
"showOutput": "always",
"options": {
"cwd": "${workspaceRoot}/MyAppName"
},
"tasks": [
{
"taskName": "build",
"args": ["build:debug"]
},
{
"taskName": "build:debug",
"args": ["build:debug"]
},
{
"taskName": "build:release",
"args": ["build:release"]
}
]
}
我查看了其他问题,目前似乎没有任何内容表明如何在 tasks.json 2.0 中运行 gulp。
我希望能够从包含 gulpfile 的文件夹之外使用此构建任务。我知道如果打开了我的 gulpfile 的文件夹,VS 会自动检测任务。