Live Server for VS Code
A lightweight local development server for VS Code with automatic browser reload.
Features
- Serves files from your current workspace folder
- Auto-injects a live-reload client into HTML pages
- Uses WebSocket to trigger reload on file changes
- Supports CSS hot refresh (
refreshcss) without full page reload
- Includes directory listing when no
index.html exists
Commands
Live Server: Start Server (liveServer.start)
Live Server: Stop Server (liveServer.stop)
How It Works
- Start the server from VS Code.
- Opened browser points to
http://localhost:5500.
- HTML responses get an injected live-reload script.
- File watcher detects changes and sends:
reload for non-CSS changes
refreshcss for CSS changes
Development
npm install
npm run compile
npm test
Watch mode:
npm run watch
Requirements
- VS Code
^1.80.0
- Node.js runtime compatible with project dependencies
License
See LICENSE.
| |