I have a dependency that is written in TypeScript. The dependency includes source maps and original source in the NPM package. If I set a breakpoint in my code and then step into the dependency, it correctly steps into the TypeScript rather than the compiled JavaScript. However, if I set a breakpoint in the TypeScript code and then launch my app, VSCode says
Breakpoint ignored because generated code not found (source map problem?).
If I set a breakpoint after stepping into the dependency everything works.
I believe the problem here is that source maps are one-way, so when I have a breakpoint in a TypeScript source file, it doesn't know where that is in JavaScript (which is required to actually set the breakpoint via node debugger). Once the JavaScript file is open, VSCode is able to match the two up and now breakpoints work.
So the question is, how can I make it so that my TS breakpoints work from startup, without having to first step into the file? The dependency is many files and having to reset my breakpoints every run is problematic, especially since the particular issue I am debugging runs into socket connection timeouts if I take too long (more than a couple seconds).
What I want is a way to tell TypeScript, "parse these JavaScript files when the debugger is launched and sync up the source maps so breakpoints match up correctly".
I know that the general functionality is available because I can successfully debug the dependency itself (I am the maintainer of the dependency) via breakpoints in TypeScript files. It just seems that some information is lost when it is loaded as an NPM module.