How to debug using ts source files on Android in Ionic 3


#1

Hi, I’ve have just started again doing some dev here. I am sure I use to be able to do this, but now, when I run my app on my Android be running. I just create a starter project, added Android platform, and launch via

ionic cordova run android -l

I open Chrome://inspect etc, I can see the app, but no ts files (only the bundled and other js files)

My current setup is

$ ionic info

cli packages: (C:\Users\pchapman\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.1.0
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.0.2
    Node              : v8.11.3
    npm               : 5.6.0
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\pchapman\AppData\Local\Android\sdk

Misc:

    backend : legacy

Can anyone help me here?

Thanks in advance


#2

For me, the answer here worked, ie I had to add

"config": {
    "ionic_bundler": "webpack",
    "ionic_source_map_type": "#inline-source-map"
  }

to my package.json. I wonder if this should be in the default project template file?