使用VSCode一键检查语法编译脚本以及启动

官方文档内代码编辑环境配置内有介绍如何用vscode可设置快捷键使用curl对脚本进行编译.
https://docs.cocos.com/creator/manual/zh/getting-started/coding-setup.html#添加-vs-code-编译任务
但这里要进行编译然后再进行启动很麻烦:
可使用自己编辑启动前任务进行结合:

在tasks.json进行修改.其中checkGrammar为检查语法,compile为编译
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
“version”: “2.0.0”,
“tasks”: [
{
“label”: “compile”,
“command”: “curl”,
“args”: [
http://localhost:7456/update-db
],
“type”: “shell”,
“isBackground”: false,
“group”: {
“kind”: “build”,
“isDefault”: true
},
“presentation”: {
“reveal”: “silent”,
“clear”: true
},
“problemMatcher”: [
“$eslint-compact”
]
},
{
“label”: “checkGrammar”,
“command”: “tsc -noEmit”,
“args”:[],
“type”: “shell”,
“isBackground”: false,
“group”: {
“kind”: “build”,
“isDefault”: true
},
“presentation”: {
“reveal”: “silent”,
“clear”: true
}
},
{
“label”: “MyBuild”,
“dependsOn”: [
“checkGrammar”,
“compile”
]
}
]
}

在launch.json文件内增加"preLaunchTask": “MyBuild”,为启动前增加检查语法和编译的任务
{
“version”: “1.4.0”,
“configurations”: [
{
“name”: “Creator Debug: Launch Chrome”,
“type”: “chrome”,
“request”: “launch”,
“url”: “http://localhost:7456”,
“sourceMaps”: true,
“userDataDir”: “{workspaceRoot}/.vscode/chrome", "diagnosticLogging": false, "preLaunchTask": "MyBuild", "pathMapping": { "/preview-scripts/assets": "{workspaceRoot}/temp/quick-scripts/assets”,
“/”: “${workspaceRoot}”
}
}
]
}

这样按f5就可以一键检查语法编译脚本以及启动了.
需要安装curl及typescript

不知道如何排版代码,将就看吧