The Visual Studio Code documentation provides example tasks.json configuration that allows either typescript compilation, or markdown compilation. It does not clarify how to achieve both simultaneously.
How can that be done?
Here is a summary of the two examples...
Typescript Example
If I want VSCode to perform a typescript build step, the directions say I need to install typescript (npm install -g typescript
) and then define the following task:
{
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"showOutput": "silent",
"args": ["*.ts"],
"problemMatcher": "$tsc"
}
Markdown Example
If I want VSCode to perform a Markdown build step, the documentation says I could install a markdown plugin of my choice (e.g. npm install -g marked
), and then define a task:
{
"version": "0.1.0",
"command": "marked",
"isShellCommand": true,
"args": ["sample.md", "-o", "sample.html"]
}
Now What?
Evidently, the tasks.json may contain exactly one JSON object. Thus I cannot simply join both definitions above with a comma. On the other hand, it is possible to have multiple tasks defined within the overall task definition:
{
"version": "0.1.0",
"command": "<what goes here?>",
"isShellCommand": true,
"suppressTaskName": true, //or false?
"tasks": [
{
"taskName": "Launch Typescript"
},
{
"taskName": "Launch Markdown"
}
]
}
The above is a skeleton of legal syntax, but it is unclear how to complete the story. I am aware of discussion here and there about how to solve these kinds of issues, but there seems to be a fundamental disconnect. For example, how does VSCode know that it is supposed to execute both tasks when I press ctrl+shift+b
?
Assuredly the developers of VSCode have a more direct and simpler way to accommodate multiple build tasks. Does anyone know what that is?