15

I'm trying to debug TS project. WebStorm automatically picks up source maps and show original ts files. I don't want to use source maps and debug generated js files. How can I disable usage of source maps in WebStorm?

NOTE: this question is not about how to disable source maps generation, it's about how to disable source maps usage during debugging

10
  • Why do you want to create the source map, but not use it? Commented Jan 27, 2017 at 14:01
  • I didn't create them, they are created by a package authors Commented Jan 27, 2017 at 14:02
  • 2
    no way; when the generated file is loaded, debugger finds the sourcemap by //# sourceMappingURL comment in it and then resolves original file using sourcemap. You can try deleting the comments from generated files (if you are permitted to do this) Commented Jan 27, 2017 at 14:09
  • @lena, thanks, that's sad. are there any plans to provide options for that? Commented Jan 27, 2017 at 14:12
  • 2
    Still not possible in 2023 :( Found issue on YouTrack, please upvote so JetBrains increases prio on this youtrack.jetbrains.com/issue/WEB-61256/… Commented Oct 18, 2023 at 10:47

1 Answer 1

10

One option is to check if there's a tsconfig.json file and in it, you can disable the sourceMap generation:

{
  "compilerOptions": {
    "sourceMap": false
  }
}

Another option, is to disable the use of source map files in your browser's debugger, for instance in Chrome you can uncheck this option:

enter image description here

Under Settings -> Preferences

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

1 Comment

as I mention in my question, this question is not about how to disable source maps generation, it's about how to disable source maps usage during debugging and I'm debugging in WebStorm, not a browser

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.