Typescript and Nodemon


$ yarn add --dev nodemon


nodemon.json


{
  "ignore": ["node_modules"],
  "watch": ["./src/**/*.ts"],
  "exec": "npm run start",
  "ext": "ts"
}


package.json

"scripts": {
    "start": "NODE_PATH=./src ts-node src/index.ts",
    "build": "NODE_PATH=./src tsc",
    "start:prod": "npm run build && NODE_PATH=./src node build/index.js",
    "start:dev": "NODE_PATH=./src nodemon"
  }


$ npm run dev