Home > Development Tools > VSCode > body text

How vscode enables code to be opened in the browser and refreshed in real time

王林
Release: 2019-12-14 16:11:42
Original
7847 people have browsed it

How vscode enables code to be opened in the browser and refreshed in real time

Search for the "view in browser" plug-in in the vscode extension and click to install it. Click the explorer to select the current file, right-click and select "View In Browser" to open the page in the default browser.

How vscode enables code to be opened in the browser and refreshed in real time

Real-time refresh method: livereload

Run the command in the project directory:

browser-sync start --server --files "**/*.css,**/*.html,**/*.js"
Copy after login

Select "Integrated Terminal" in View", command Enter the above command on the line

How vscode enables code to be opened in the browser and refreshed in real time

Right-click the local file and select "Open in Terminal", enter the command

How vscode enables code to be opened in the browser and refreshed in real time

# in the terminal command line ##The above two methods have the same effect and principle. They can both run in the background. Press the shortcut key "control c" to exit the current running process.

Recommended related article tutorials:

vscode tutorial

The above is the detailed content of How vscode enables code to be opened in the browser and refreshed in real time. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!