Skip to content

Instantly share code, notes, and snippets.

@jorgeart81
Forked from Klerith/configurar-node-ts.md
Created October 26, 2023 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgeart81/ff11723c524488b171fbc60f3132dc95 to your computer and use it in GitHub Desktop.
Save jorgeart81/ff11723c524488b171fbc60f3132dc95 to your computer and use it in GitHub Desktop.
Node con TypeScript - TS-Node-dev simplificado

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/app.ts",
  "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