From the course: Learning Visual Studio Code

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Creating custom tasks

Creating custom tasks

Task in VS Code aren't limited to what the application can detect in tools like npm and Gulp. You can also create your own custom tasks to launch any script or process you have permission to run on your computer. It's all done by configuring additional task in your tasks.json file, like the one here we customized earlier. To add a custom task, I could just copy the one already in this file and paste it as a second element in the task array. I could then make whatever changes I want to it. However, I want to show you how to create a custom task if you don't already have a tasks.json file in your project. I'll first close the existing file. I'll then delete it in the file explorer. Remember that it lives in the .vscode directory. I'll now open the command palette and search for task. I'm going to run the configure task command. That auto detects the two npm scripts I already discussed, but just below that is an option to create tasks.json file from template. Since I no longer have a…

Contents