DEV Community

Discussion on: Setting up a React Environment for ASP.NET MVC

Collapse
 
abimr profile image
abimr • Edited

Thanks for your tutorial! I now have a non-trivial React app in an ASP.NET MVC 5 project.

But now I need to be able debug the React app from VSCode/Chrome.

My webpack entrypoint is ./Scripts/react/index.jsx. The output is ./Scripts/dist/react/bundle.js. What should be my "webRoot" and "sourceMapPathOverrides" values in .vscode/launch.json? Am I missing other values?

  {
    "version": "0.2.0",
    "configurations": [
      {
        "name": "Chrome",
        "type": "chrome",
        "request": "launch",
        "url": "http://localhost:23042",
        "webRoot": "${workspaceFolder}/Scripts/react",
        "sourceMapPathOverrides": {
          "webpack:///Scripts/react/*": "${webRoot}/*"
        }
      }
    ]
  }