I have a startup script for my application running in vscode, that I normally configure in my tasks.json file.
I want to run yarn watch and then my startup script after yarn watch finished compiling and actually watches. (The order of execution matters in this case)
However, since yarn watch is an open ended task that essentially runs to watch until its manually closed the second script never executes due to yarn watch not finishing
task.json
{
"label": "Yarn watch",
"type": "shell",
"command": "yarn watch",
"windows": {
"command": "yarn watch"
},
"problemMatcher": []
},
{
"label": "Run Dev",
"type": "shell",
"command": "./scripts/code.sh",
"windows": {
"command": ".\scripts\code.bat"
},
"problemMatcher": [],
"dependsOrder": "sequence",
"dependsOn": [
"Yarn watch"
]
}
I already tried running it as a seperat bat script, which caused the same issues and produced another one. When I run it as a script, it doesnt open in the VSCode console but in a seperat windows one, which gets really messy over time.
The end result should be that when i start “Run dev”. A first VSCode console appears, runs yarn watch, finishes and then a second VSCode console window appears that runs the actual build.