lukeed / tsm

TypeScript Module Loader
MIT License
1.18k stars 19 forks source link

Consider adding support for sourcemaps (specifically for tracebacks)? #32

Closed willstott101 closed 1 year ago

willstott101 commented 2 years ago

I love this module for fast development, but the incorrect line numbers in the output is a real issue for me.

Would you consider a PR which adds sourcemap support via something like: https://github.com/evanw/node-source-map-support

...or would the additional dependencies be a total no-go?

lukeed commented 1 year ago

Added sourcemap support when using tsm directly (as opposed to node -r tsm and node --loader tsm usage).

This is done via Node's native --enable-source-maps flag which works well (Node 12.12 and up, experimental warning removed in Node 15)