Home  >  Article  >  Development Tools  >  How vscode enables code to be opened in the browser and refreshed in real time

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

王林
王林Original
2019-12-14 16:11:427948browse

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"

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!

Statement:
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