Skip to content

Commit

Permalink
add support for debugging external node internals
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Oct 29, 2020
1 parent 8355f70 commit 737f6c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/targets/node/nodeSourcePathResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ export class NodeSourcePathResolver extends SourcePathResolverBase<IOptions> {
// replace any query string, which can be generated by webpack bundles
url = url.replace(/\?.+/, '');

// Allow debugging of externally loaded Node internals
// [ by building Node with ./configure --node-builtin-modules-path $(pwd) ]
if (url.startsWith('node:')) {
url = url.replace('node:', this.options.basePath + '/lib/');
if (!url.endsWith('.js')) url += '.js';
}

if (map) {
return this.sourceMapSourceToAbsolute(url, map);
}
Expand Down

0 comments on commit 737f6c0

Please sign in to comment.