I built a repo to expose my issue: https://github.com/franklin626/custom_webpack_undebuggable
This Angular CLI app has a custom webpack setup (webpack.config.js
). It also has a .vscode/launch.json
configuration to debug from VS Code upon either ng test
(unit tests) or ng serve
. I can place breakpoints for my unit tests, but not when running ng serve
:
In my debug tab in VS Code, I run my "launch Chrome" routine followed by "attach localhost". I place a breakpoint on other.component.ts:14
, and browse to localhost:4200/othermodule to fire up my lazy loaded module OtherModule
containing OtherComponent
.
I can't place a breakpoint on home.component.ts:13
either, even though it is in the default module.
VS Code complains the breakpoint can't be hit and suggests a possible problem with source maps. I can see the original sources are loaded in the browser though. What is going on ?