配置tasks.json
1.打开VS Code,点击“终端”,选择“配置任务”。
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "在Chrome中运行",
"type": "process",//shell
"command": "Chrome",
"args": ["${file}"],
"windows": {
"command": "本机谷歌安装位置"
},
"group": "build",
"presentation":{
"echo": true,
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"problemMatcher":"$msCompile",
}
]
}
复制代码
运行任务
1.选中要运行的HTML文件,按住ctrl+shift+B,选择“在chome运行”