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

前端 未结 5 2170
盖世英雄少女心
盖世英雄少女心 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:25

    Source map support works perfectly fine with node

    All you need to do is add

    "source-map-support": "0.4.11",
    

    to dependencies or dev-dependencies in package.json by running

    npm install --save source-map-support
    

    And in your entry point ts file, simply add at the top

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

    (note: this is calling nodeJS require - there is no need for source-map-support definition files)

提交回复
热议问题