Skip to content

Instantly share code, notes, and snippets.

@EduardoMay
Last active April 5, 2021 03:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save EduardoMay/d43b0f333b658ca040f8f93bf1ec048a to your computer and use it in GitHub Desktop.
Use typescript with nodemon

npm init --yes

npm i -D nodemon typescript ts-node nodemon @types/node

package.json

"dev": "nodemon --config nodemon.json src/index.ts"

nodemon.json

{
  "restartable": "rs",
  "ignore": [".git", "node_modules/", "dist/", "coverage/"],
  "watch": ["src/"],
  "execMap": {
    "ts": "node -r ts-node/register"
  },
  "env": {
    "NODE_ENV": "development"
  },
  "ext": "js,json,ts"
}

npm run dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment