Ngo*_*ham 6 gruntjs visual-studio-code
我有VSCode版本1.18.1,这在我的 Gruntfile.js
grunt.registerTask('release', 'Release process', function(target) {
...
}
Run Code Online (Sandbox Code Playgroud)
那target是我可以运行grunt release:one或grunt release:two.但是,我无法弄清楚如何使VSCode与one|two目标一起运行任务.
这是tasks.json使用自动检测到的Grunt任务创建的文件VSCode.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "grunt",
"task": "release",
"problemMatcher": [],
"label": "Release Process",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
如果我把文件release:one的task属性tasks.json,VSCode会抱怨类似的东西
Error: The grunt task detection didn't contribute a task for the following configuration:
Run Code Online (Sandbox Code Playgroud)
有人做过类似的事吗?你能指导我怎么做吗?
谢谢!
我自己解决这个问题的方法是创建一个类型的任务shell,然后输入完整的命令。例如,您可以执行以下操作:
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Release one",
"command": "grunt release:one",
"problemMatcher": [],
}, {
"type": "shell",
"label": "Release two",
"command": "grunt release:two",
"problemMatcher": [],
}
]
}
| 归档时间: |
|
| 查看次数: |
670 次 |
| 最近记录: |