I was trying to something similar but mine was to debug a third-party packages under node_modules written in TS. I got the source code and recompile the package to emit mapping and use my own output to replace the package under node_modules. I also have to update resolveSourceMapLocations in launch.json to allow source mapping for that specific package. This works for me.