parcel-bundler / website

🌎 Parcel website
https://parceljs.org
MIT License
350 stars 467 forks source link

Anyone update https://parceljs.org/recipes/debugging/ ? #972

Closed trancephorm closed 2 years ago

trancephorm commented 3 years ago

Instructions given there about how to make debugging work in VS Code are not working.

chhch commented 2 years ago

I had the problem that breakpoints were ignored. After reading https://github.com/parcel-bundler/parcel/issues/611#issuecomment-696487932. I changed the sourceMapPathOverrides to "/__parcel_source_root/*": "${webRoot}/*". This launch configuration works for me:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:1234",
      "webRoot": "${workspaceFolder}",
      "breakOnLoad": true,
      "sourceMapPathOverrides": {
        "/__parcel_source_root/*": "${webRoot}/*"
      }
    }
  ]
}

If it also works for others, this may also close #578.

padcom commented 2 years ago

This should definitely be in the docs and frankly speaking also in the generator for launch.json, because there are overrides for webpack and I think for meteor (why???). So why not have Parcel overrides added there automagically...

mischnic commented 2 years ago

So this line that's currently on https://parceljs.org/recipes/debugging should be removed?

 `"../*": "${webRoot}/*",`
padcom commented 2 years ago

Yes, that doesn't make any sense.