preboot / angular-webpack

A complete, yet simple, starter for Angular v2+ using webpack
MIT License
1.29k stars 557 forks source link

cannot find .ts files in chrome debugger #328

Closed phil123456 closed 7 years ago

phil123456 commented 7 years ago

Hi,

I can only see js files, and only 3 of them app, vendor and polyfills

there are also tons of .ts files in webpack://./src/app but they dont seem to be debugable breakpoints do not work

any hint on this ?

thanks

josueadelima commented 7 years ago

This is not a issue, should be closed ....

phil123456 commented 7 years ago

it works with all other seeds I downloaded so far, so it IS an issue

why are the map files not shown ? I am an angular noob, so a little help would be apreciated thanks

mcescalante commented 7 years ago

@phil123456 It sounds like your question is "why can't I see Typescript in the browser?". The entire point of webpack (and building an angular app) is that the Typescript is transpiled into Javascript only. Browsers do not know how to interpret Typescript.

phil123456 commented 7 years ago

you're telling we on cannot debug typescripts on a dev environement when using webpack ? anyone doing js/ts/angular/(whatever related programming) will need to debug application every once in a while...

phil123456 commented 7 years ago

I see that in the webpack config, there are some environement variables (process.env.npm_lifecycle_event) but how do I set these when running the web application ?

var ENV = process.env.npm_lifecycle_event;
var isTestWatch = ENV === 'test-watch';
var isTest = ENV === 'test' || isTestWatch;
var isProd = ENV === 'build';

  if (isProd) {
    config.devtool = 'source-map';
  }
  else if (isTest) {
    config.devtool = 'inline-source-map';
  }
  else {
    config.devtool = 'eval-source-map';
  }
phil123456 commented 7 years ago

come on , I tried forcing the value to

config.devtool = 'source-map';

with no luck

my collegues here who are more advanced in angular tell me it should work, so there is clearly a problem with this setup

nobody in your group never done any TS debugging ?

strictd commented 7 years ago

i recently started using '#source-map' instead of 'source-map'

phil123456 commented 7 years ago

tried that before, does not work either

phil123456 commented 7 years ago

it works with #inline-source-map so why the... anyway, definetely a google/webpack issue (yes, CLEARLY an issue) for info : ts files are located in webpack/src/...

phra commented 7 years ago

as you can CLEARLY see, the browser correctly display typescript files under webpack folder. closing this.

schermata da 2017-04-06 10-54-44