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
user944513
  • 12,247
  • 49
  • 168
  • 318

1 Answers1

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
Community
  • 1
  • 1
jornare
  • 2,903
  • 19
  • 27
  • 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. – jornare Feb 12 '16 at 11:41
  • actually please download the code then you find it not working – user944513 Feb 12 '16 at 11:44
  • I find the https://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. – jornare Feb 12 '16 at 11:45
  • yes ...So what is best way to debug the code ..because if there is an error ..than how I found – user944513 Feb 12 '16 at 11:45
  • I did. I get the sourcemaps, and in chrome they are located under 'webpack://' in the sources directory in the dev-tools. – jornare Feb 12 '16 at 11:46
  • could you please tell me how to make hello world in angular 2 ..using webstrom and typscrict – user944513 Feb 12 '16 at 11:47
  • i did not get ...files – user944513 Feb 13 '16 at 02:25