auchenberg / vscode-browser-preview
- среда, 23 января 2019 г. в 00:16:04
 
TypeScript
A real browser preview inside your editor that you can debug.
Browser Preview for VS Code enables you to open a real browser preview inside your editor that you can debug. Browser Preview is powered by Chrome Headless, and works by starting a headless Chrome instance in a new process. This enables a secure way to render web content inside VS Code, and enables interesting features such as as in-editor debugging and more!
Browser View: Open PreviewMake sure you have Google Chrome installed on your computer.
chrome://inspectbrowser-preview.startUrlYou can enable in-editor debugging of Browser Previews by installing Debugger for Chrome, and configure VS Code's debugger to either attach or launch to the browser previews by using the following configuration:
{
  "version": "0.1.0",
  "configurations": [
    {
      "type": "browser-preview",
      "request": "attach",
      "name": "Browser Preview: Attach"
    },
    {
      "type": "browser-preview",
      "request": "launch",
      "name": "Browser Preview: Launch",
      "url": "http://localhost:3000"
    }
  ]
}The debug configuration also supports these additional properties: webRoot, pathMapping, trace, sourceMapPathOverrides and urlFilter. See https://github.com/Microsoft/vscode-chrome-debug#other-optional-launch-config-fields for details on how to use.
Browser Preview has the following settings:
"browser-preview.startUrl": // The default start url for new Browser Preview instances