Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript + Electron source maps

I have a project with Typescript and Electon. I want the console errors referenced to Typescript files, instead of javascript minified files. I read it could be done with source maps.

I see some references like this but I have not achieved my goal.

like image 866
Abel Avatar asked May 11 '16 14:05

Abel


2 Answers

I was able to get it to work by enabling both inlineSourceMap and inlineSources in tsconfig.json.

like image 138
emlai Avatar answered Nov 15 '22 06:11

emlai


I was able to get this working with the npm module 'source-map-support'.

Install it in your project as follows:

npm install --save source-map-support

Then require it into your Electron renderer process at the first line of code as follows:

require('source-map-support').install();

See here for full details: https://www.npmjs.com/package/source-map-support

like image 33
Ashley Davis Avatar answered Nov 15 '22 08:11

Ashley Davis