0

I download this example https://github.com/angular/angular2-seed .I am using webstrom editor and then use npm install then I use npm start..Apllication is running fine but I am not able to debug the app ..how I will debug the app? is there any way to debug the app

I follow all steps

Clone or fork this repository
Make sure you have node.js installed
run npm install to install dependencies
run npm start to fire up dev server
open browser to http://localhost:8080
5
  • Where do you want to debug? Which IDE? In the browser just open the devtools and set a breakpoint. In WebStorm you might be able to just set a breakpoint before or while you're running the application. Please provide more information about what you're trying to accomplish. Commented Feb 12, 2016 at 11:02
  • Anctually it minified all files Commented Feb 12, 2016 at 11:08
  • You might need to disable minification. You might need to enable source maps in the browser devtools settings (I don't use TS myself and don't know details) Commented Feb 12, 2016 at 11:09
  • I need debug at chrome.. Commented Feb 12, 2016 at 11:10
  • Ya but i am not able to seacrh where i comment the code Commented Feb 12, 2016 at 11:13

1 Answer 1

2

The webpack configuration on in this angular2 seed application is not configured to use sourcemaps. Have a look here: How do I generate sourcemaps when using babel and webpack? for some hints

In short: In your tsconf.json:

{
  "compilerOptions": {
    "module": "commonjs",
    "sourceMap": true //Set to true to get source maps from .ts, not .js
  },
  "files": [
    ...
  ]
}

In your webpack.config:

module.exports = {
  devtool: 'source-map', // to generate sourcemaps
Sign up to request clarification or add additional context in comments.

7 Comments

If you restart the webpack server, you will get sourcemaps. -But I see this solution gives you sourcemaps for your compiled .ts files, not the actual source.
actually please download the code then you find it not working
I find the github.com/AngularClass/angular2-webpack-starter project to be quite useful. It also contains setup for testing, so it might be overkill for you if you are only playing.
yes ...So what is best way to debug the code ..because if there is an error ..than how I found
I did. I get the sourcemaps, and in chrome they are located under 'webpack://' in the sources directory in the dev-tools.
|

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.