microsoft/vscode-livepreview
TypeScript
Captured source
source ↗microsoft/vscode-livepreview
Description: Hosts a local server in your workspace for you to preview your webpages.
Language: TypeScript
License: MIT
Stars: 573
Forks: 109
Open issues: 119
Created: 2021-05-21T21:38:51Z
Pushed: 2026-06-14T02:20:08Z
Default branch: main
Fork: no
Archived: no
README:
Live Preview - VS Code Extension 📡
⚠️ WARNING: This extension is still under development! ⚠️
An extension that hosts a local server for you to preview your web projects on!
This extension is most useful for projects where a server is not already created (e.g. not for apps using React, Angular, etc.). To work with these, feel free to use the integrated browser in VS Code.
Table of Contents
- [Features](#features)
- [Running the Extension](#running-the-extension)
- [FAQ](#faq)
- [Inspirations](#inspirations)
- [Issue Tracking](#issue-tracking)
- [Changelog](#changelog)
Features
HTML File Previewing
Preview your HTML files quickly by clicking the preview button in the top right corner of your editor or using the context menu.
!open-preview-btn !open-context-menu
Embedded Preview
A preview is available in-editor for the files hosted by the server.
The simple embedded browser features the following:
- Page history tracking
- URL bar for address-based navigation
- Expandable menu, allowing users to:
- Preview the current page in browser
- Perform a page search
- Tip: You can also use CTRL+F to open the find box and Enter to go to the next result
- Open the editor's webview DevTools
Live Refreshing
See the changes as you make them. By default, changes appear as you make them in the editor. You can also change this in the extension settings (via livePreview.autoRefreshPreview) to refresh the preview on save or not at all.
Individual pages can opt out of live refreshing by adding the ` attribute data-server-no-reload`.
Persistent Server Task with Server Logging
If you're looking for a persistent server to run, you can run a Live Preview task, which also logs the server traffic. This can also be launched using the Live Preview: Start Server Logging command. You can click on the traffic to open the file location of the file returned by the server.
External Browser Previewing
Although all of the images above use the embedded browser, you can also experience the same features in an external browser.
You can edit the preview target in the extension settings.
External Browser Debugging
The external browser preview also supports debugging via the built-in js-debug extension and attaching to the Edge Devtools Extension. This allows support for features such as setting breakpoints and inspecting elements.
Run Live Preview: Show Debug Preview in the command palette to get these debugging features.
Console Output Channel (For Embedded Preview)
For a simple view of the embedded preview's console messages, go to the Output tab and select Embedded Live Preview Console in the dropdown.
Workspace-less Previewing
No workspace? No problem! For a quick preview of your file, the server can also access files outside of your workspace to preview.
Notes about workspace-less extension use:
- Files without a workspace will be served on its own server instance and will use its absolute path as the file path.
- Linked files for these pages may not be correct if they are relative to a specific root (e.g. a project root).
- Tasks do not work outside of a workspace, so a server will just launch in the background upon external preview when outside of a workspace. You can use the
Live Preview: Stop Servercommand to kill the server in this case.
Multi-root Support
Live Preview works cleanly with your multi-root workspaces! It will simply open an additional server for each root that you open a preview on.

You can view the ports that are open for Live Preview by hovering the status bar indicator (usually located in the bottom-right corner of the window).

Running the extension
You can install the extension in the marketplace here. To contribute, see the contributing page.
FAQ
Q. What does the `"Previewing a file that is not a child of the server root. To see fully correct relative file links, please open a workspace at the project root or consider changing your server root settings for Live Preview."` message mean?
A. Either:
- You have no workspace open and opened a preview.
- You opened a preview for a file that is not a part of your workspace(s).
- You have the
livePreview.serverRootsetting set to a sub-folder in your workspace and your file is not a child of that subfolder.
Why does this happen?
The server is hosted from the root of the workspace that the user...
Excerpt shown — open the source for the full document.
Notability
notability 3.0/10Routine dev tool release, not AI-focused.