Typescript + Electron source maps
Asked Answered
G

2

8

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.

Gellman answered 11/5, 2016 at 14:53 Comment(2)
What have you tried? Can you give us more context, like the way you compile your TS?Virnelli
@Gellman were you able to fix it?Neptune
R
3

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

Russia answered 9/9, 2018 at 2:17 Comment(0)
G
3

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

Georgiageorgian answered 17/11, 2019 at 15:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.