0

In my project, I have an /src folder that contains .ts files and I setup tsconfig.json to compile those in a folder called /dist into .js and source map .js.map.

Now I run the code using the commande node /dist/whatever.js But Let's say there in a error. The error logs maps to the compiled .js files. enter image description here How to make it map to the original .ts file ? I assume this is possible because that's the use of source map.

erro

2 Answers 2

1

Happened to see this question. I didn't really use IntelliJ, but I have been using source-map-support to do the trick. You could either programmtically add import 'source-map-support/register';, or invoke node CLI node -r source-map-support/register compiled.js. Hope that helps.

Sign up to request clarification or add additional context in comments.

Comments

-1

I see you are using IntelliJ. You can exclude directories so they will not be indexed.

enter image description here

1 Comment

How is this mapping the errors trace to the Typescript file ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.