react debug from VS Code —— Live edit and debug your React apps directly from VS Code — without leaving the editor

原文:https://medium.com/@auchenberg/live-edit-and-debug-your-react-apps-directly-from-vs-code-without-leaving-the-editor-3da489ed905f

 

Supercharge your React debugging workflow with VS Code and Chrome debugging

 

 

 You can now write code, set a breakpoints, make a changes to the code, and debug your newly modified code — all from your editor

 

How to get started in 6 steps

  1. Download the latest release of VS Code and install our Chrome debugger
  2. Create your React app using create-react-app
  3. Use the following config for your launch.jsonfile to configure the VS Code debugger and put it inside .vscode in your root folder.
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Chrome",
            "type": "chrome",
            "request": "launch",
            "url": "http://localhost:3000",
            "webRoot": "${workspaceRoot}/src"
        }
    ]
}

  

Details

Our Chrome debugger now supports Webpack’s Hot Module Replacement mechanism, which pushes module changes to the browser by running a local file watcher.

 

 

 

posted @ 2021-03-15 15:36  PanPan003  阅读(67)  评论(0编辑  收藏  举报