How to watch and reload ts-node when TypeScript files change

后端 未结 11 1518
梦如初夏
梦如初夏 2020-11-30 17:00

I\'m trying to run a dev server with TypeScript and an Angular application without transpiling ts files every time. I found that I can do the running with ts-node

11条回答
  •  粉色の甜心
    2020-11-30 17:35

    Another way could be to compile the code first in watch mode with tsc -w and then use nodemon over javascript. This method is similar in speed to ts-node-dev and has the advantage of being more production-like.

     "scripts": {
        "watch": "tsc -w",
        "dev": "nodemon dist/index.js"
      },
    

提交回复
热议问题