Home > Article > Development Tools > 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.
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
Right-click the local file and select "Open in Terminal", enter the command
# 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: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!