I have a workspace that I use for smaller test programs I write to practice concepts. Hence, in VS Code, I have a build task for each file in the folder.
By default,
You can use the ${file}
wildcard to pass the current file to your build program/script.
There's an example given in the docs for TS: https://code.visualstudio.com/Docs/editor/tasks#_operating-system-specific-properties
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"presentation": {
"panel": "new"
},
"tasks": [
{
"taskName": "TS - Compile current file",
"type": "shell",
"command": "tsc ${file}",
"problemMatcher": [
"$tsc"
]
}
]
}