Skip to content

Instantly share code, notes, and snippets.

@codewithleader
Last active March 17, 2024 07:01
Show Gist options
  • Save codewithleader/a38acc6e4e0f0ec95ae983bc5263b698 to your computer and use it in GitHub Desktop.
Save codewithleader/a38acc6e4e0f0ec95ae983bc5263b698 to your computer and use it in GitHub Desktop.
NodeJS + Typescript Configuracion usando NODEMON

Node con TypeScript - Nodemon

  1. Instalar TypeScript y demás dependencias
npm i -D typescript @types/node ts-node nodemon rimraf
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
  1. Crear archivo de configuración Nodemon - nodemon.json
{
  "watch": ["src"],
  "ext": ".ts,.js",
  "ignore": [],
  "exec": "npx ts-node ./src/app.ts"
}
  1. Crear scripts para dev, build y start
  "dev": "nodemon",
  "build": "rimraf ./dist && tsc",
  "start": "npm run build && node dist/app.js"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment