How do I make sourcemaps work with typescript? #10082
Unanswered
rikimaru0345
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I created a project using
npx create-react-app my-app --template typescript
and then created a build withnpm run build
.When an exception occurs I get a stack trace like this for example:
In order to find the issue I used this tool: https://www.npmjs.com/package/source-map-cli
However, that shows the code region of the compiled .js code (seemingly the output of the typescript compiler).
While its not as bad as the minified code webpack created, it's still pretty bad.
How do I get the stack trace that refers to the acutal source files? (
.ts
/.tsx
)What tool would I use for that? Is source-map-cli the correct one, or is there a tool specifically for typescript?
Do I need to do some sort of "double decoding"? Like decoding from webpack-minified-js => compiled typescript output, and then another decoding step to get from the typescript output to the actual typescript files?
Beta Was this translation helpful? Give feedback.
All reactions