With a productivity plugin, you have more time to fish!!
Today’s recommended VSCode plug-in is called Live Server, it functions very similar to serve, just need two mouse clicks to set up a Server in the current directory, at the same time automatically open the browser to access the file you click. It also supports auto-reload, so when you make changes to a file, the browser automatically refreshes, eliminating the need to reload (save every second, no problem).
The characteristics of
- Two mouse clicks (or shortcut Alt +L Alt +O) automatically open the browser to access the current page
- Supports automatic file reload
- Customizable port
- Support exclusion file
- Support shortcut keys
- Customizable browser
- You can modify the default host
- Support SVG
- Support HTTPS
- Support agent
- CORS open
The installation
First search for the Live Server to install. After the installation is complete, you do not need to reload the VSC.
use
open
The mouse operation
In the VSCode menu bar, right-click the HTML file and click Open with Live Server.
shortcuts
Alt+L O, remember L and O while holding Alt, not Alt+L or Alt+O alone.
A prompt will be given in the lower right corner after the opening is complete.
Shut down
Alt + L C.
Other configuration
Files => Preferences => Settings => Search for Live Server.
Modify the port. The default port is 5500. Keep in mind that changing ports requires shutting down the Server and then turning it on for the port configuration to take effect.
Modify the default browser.
Specify the host.
Set the HTTPS.
Specify the proxy.
You can also browse in the VSC without opening the browser.
END
If you find this article useful, click “like” to browse and follow it