3

We use this setting in development:

  • we develop our angular project in typescript using IntelliJ IDEA
  • transpile our typescript code to javascript with grunt-ts
  • concatenate all transpiled javascript files to one singe all.js file using grunt-contrib-concat
  • all.js file is referenced in html

The problem is that we run our app from concatenated all.js file so we can't debug it. Any ideas on how can we debug our source code in typescript? Is there any development-wise solution or advice to this?

5
  • it is possible but you must let tsc concatenate the files. In the current version TypeScript that comes with some restrictions on how the code is written, in the @next version it works out of the box if you use amd or system packages. You can check the response to this question for more details stackoverflow.com/questions/34474651/… Commented Dec 28, 2015 at 10:48
  • 2
    We use gulp-typescript plugin and for development purposes we reference all the .js files in .html page. Then I simply debug JS files through Google Chrome. It works for me very well. Commented Dec 28, 2015 at 13:00
  • 1
    You'll need to use sourcemaps. Add the outFile and sourceMaps options in tsconfig and get rid of grunt-concat. Commented Dec 28, 2015 at 14:32
  • Are you compiling with mode set to "commonjs"? In any case using something like grunt-browserify might be a good solution. Commented Dec 29, 2015 at 16:33
  • Jetbrains explained it in here: jetbrains.com/webstorm/help/debugging-typescript.html Commented Feb 15, 2016 at 21:30

0

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.