Is there source map support for typescript in node / nodemon?

前端 未结 5 2059
盖世英雄少女心
盖世英雄少女心 2021-01-31 14:34

I have a node project written in typescript@2.

My tsconfig has sourceMap set to true and the *.map.js files are generated. When I

5条回答
  •  难免孤独
    2021-01-31 15:24

    I recently got this working in my express app. Steps as follows:

    Install the required library:

    npm install --save-dev source-map-support

    In your entry point (eg app.ts):

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

    In your app.ts, you may also require better logging for errors within promises:

    process.on('unhandledRejection', console.log);

    In your tsconfig, under compilerOptions:

    "inlineSourceMap": true

提交回复
热议问题