0

How can I debug a monorepo with multiple workspaces in VS Code during development at the same time?

Workspace1: /packages/framework -> will be included in an npm package later

Workspace2: /apps/website -> website which imports /packages/framework via node_modules

launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Monorepo Debug (Vite Website + Framework)",
      "url": "http://192.168.0.200:3001",
      "webRoot": "${workspaceFolder}/apps/website",
      "enableContentValidation": false,
      "trace": true,
      "sourceMapPathOverrides": {
        "vite:///src/*": "${workspaceFolder}/apps/website/src/*",
        "vite:///packages/framework/src/*": "${workspaceFolder}/packages/framework/src/*",
        "/packages/framework/src/*": "${workspaceFolder}/packages/framework/src/*",
        "/src/*": "${workspaceFolder}/apps/website/src/*"
      }
    }
  ]
}

With "webRoot": "${workspaceFolder}/apps/website", I can set breakpoints in apps/website

With "webRoot": "${workspaceFolder}/", I can set breakpoints in packages/framework

But not both together.

What am I doing wrong?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.