Skip to content

Instantly share code, notes, and snippets.

@codewithleader
Last active June 25, 2024 15:14
Show Gist options
  • Save codewithleader/6bafe8238067b0db0718768cf9d9e353 to your computer and use it in GitHub Desktop.
Save codewithleader/6bafe8238067b0db0718768cf9d9e353 to your computer and use it in GitHub Desktop.
NodeJS + TS Configuración con ts-node sin Nodemon

Node con TypeScript - TS-Node-dev (preferido)

  1. Instalar TypeScript y demás dependencias
npm i -D typescript @types/node ts-node-dev rimraf
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
  1. Crear scripts para dev, build y start (Más sobre TS-Node-dev aquí)
  "dev": "tsnd --respawn --clear src/main.ts",
  "build": "rimraf ./dist && tsc",
  "start": "npm run build && node dist/main.js"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment