You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

159 lines
4.5 KiB

{
"version": "2.0.0",
"tasks": [
{
"label": "安装前端依赖",
"type": "shell",
"command": "npm",
"args": ["install"],
"group": "build",
"options": {
"cwd": "${workspaceFolder}/frontend"
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "启动前端开发服务器",
"type": "shell",
"command": "npm",
"args": ["run", "dev"],
"group": "build",
"options": {
"cwd": "${workspaceFolder}/frontend"
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new"
},
"isBackground": true,
"problemMatcher": {
"pattern": {
"regexp": "^(.*)$",
"file": 1
},
"background": {
"activeOnStart": true,
"beginsPattern": ".*Local:.*",
"endsPattern": ".*ready in.*"
}
}
},
{
"label": "构建前端",
"type": "shell",
"command": "npm",
"args": ["run", "build"],
"group": "build",
"options": {
"cwd": "${workspaceFolder}/frontend"
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "安装后端依赖",
"type": "shell",
"command": "go",
"args": ["mod", "tidy"],
"group": "build",
"options": {
"cwd": "${workspaceFolder}/backend"
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "启动后端服务器",
"type": "shell",
"command": "go",
"args": ["run", "main.go"],
"group": "build",
"options": {
"cwd": "${workspaceFolder}/backend"
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new"
},
"isBackground": true,
"problemMatcher": {
"pattern": {
"regexp": "^(.*)$",
"file": 1
},
"background": {
"activeOnStart": true,
"beginsPattern": ".*Server starting.*",
"endsPattern": ".*Listening and serving.*"
}
}
},
{
"label": "构建后端",
"type": "shell",
"command": "go",
"args": ["build", "-o", "task-track", "main.go"],
"group": "build",
"options": {
"cwd": "${workspaceFolder}/backend"
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": ["$go"]
},
{
"label": "启动完整应用",
"dependsOrder": "parallel",
"dependsOn": [
"启动前端开发服务器",
"启动后端服务器"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new"
}
},
{
"label": "安装所有依赖",
"dependsOrder": "sequence",
"dependsOn": [
"安装前端依赖",
"安装后端依赖"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
}
]
}