Display original typescript file when debugging typescript using node-inspector CLI

1.1k views Asked by At

Is there any means of having the node-inspector CLI (or any CLI-based debugger) display the original typescript file when debugging?

For example, for debugging typescript, I usually run something like: nodemon -e ts -w src -x "tsc -p . && node inspect ./dist/file.js". This works, but it debugs the transpiled javascript.

To work around this, I tried using ts-node like so: nodemon -e ts -w src -x "node inspect -r ts-node/register src/file.ts". Still, the debugger will show the transpiled JS.

sourcemap: true in tsconfig does not help, either.

1

There are 1 answers

1
bhantol On

Using the latest ts-node you should be able to do something like below:-

nodemon -e ts -w src -x "node --inspect -r ts-node/register src/file.ts"

Or use --inspect-brk