This repo is linked to Stack Overflow question: https://stackoverflow.com/questions/59709512/why-setting-webroot-to-a-correct-folder-breaks-vs-code-debugging
Prerequisites:
- Enable sourcemaps in chrome dev tools
- Install a vs code extension debugger for chrome
- cd into the folder containing package.json
- run
npm i
to download the dependencies - run
npm run build
to generate app.js inside public folder - run
npm run serve
to start the dev server serving on http://localhost:9000/ - open vs code from the folder, which contains package.json (this impacts workspaceFolder variable)
- in vs code, place a breakpoint on line
console.log('b')
in index.js - go to debug and click Start Debugging green icon. After a while page loads, but breakpoint is not hit (but should be)
- in launch.json swap webRoot with a commented one. After a while page loads, and breakpoint is being hit (but shouldn't be)