labnotes

Autorun tasks on vscode startup

just a little bit easier

tags
vscode
transient

Contents

I like to have my projects open and close cleanly and easily. Here's a way to have your dev server start up when you open up your VS Code or in my case cursor projects.

Create a .vscode/tasks.json:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
  {
    "version": "2.0.0",
    "tasks": [
      {
        "label": "dev",
        "type": "shell",
        "command": "npm run dev", // or your specific dev command
        "isBackground": true,
        "problemMatcher": [],
        "presentation": {
          "reveal": "always",
          "panel": "new"
        },
        "runOptions": {
          "runOn": "folderOpen"
        }
      }
    ]
  }

Now when you open up the projects, there will be a special tasks window open up where your console and normal be and you'll be up and going. As soon as you kill your window, the whole thing will shut down and nicely go to sleep.

This is also very convenient if you set up a GitHub action so that when you push your code deploys, so basically all you're doing is opening up the thing, making some changes, committing, pushing, closing it, you're done. It's now live.

Previously

labnotes

Adding a font to astro

very simple

tags
fonts
astro
tailwind
fontsource

Next

fragments

Books in Gemini

tags
gemini
books