分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

VS Code 运行html文件

发布时间:2023-09-06 02:15责任编辑:赖小花关键词:暂无标签

用VS Code编写html文件,想在VS Code中直接打开运行,配置如下:

配置tasks.json

  1. 打开VS Code,点击“终端”,选择“配置任务”。

  2. 选择“使用模板创建tasks.json文件”。

  3. 选择“Others”。

  4. tasks.json新建完成,默认如下图:

  5. 修改tasks.json

{ ???// 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,process] ???????????"command": "Chrome", ???????????"args": ["${file}"], ???????????"windows": { ???????????????"command": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" ???????????}, ???????????"group": "build", ???????????"presentation": { ???????????????// Reveal the output only if unrecognized errors occur. ???????????????"reveal": "never" ?//[always,never,silent] ???????????}, ???????????// Use the standard MS compiler pattern to detect errors, warnings and infos ???????????"problemMatcher": "$msCompile" ???????} ???]}

运行任务

选中需要运行的html文件,按住Ctrl+Shift+B,选择“在Chome中运行”,即可。

文章出处:https://allanhao.com/2018/09/25/vscode-run-html/

VS Code 运行html文件

原文地址:https://www.cnblogs.com/hao-zhang/p/9700363.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved