May 13, 2025
A few weeks ago, I was setting up a basic TypeScript + Express backend — and I hit the same old problems:
❌ Slow reloads
❌ Config struggles
❌ ts-node-dev just wasn’t cutting it
So I looked for something better…
I found tsx — and it completely changed my workflow.
✅ What Makes tsx Better
✅ Lightning-fast reloads (powered by ESBuild)
✅ No config needed — works out of the box
✅ Full support for ESM and TypeScript
Setup Guide (Step-by-Step)
npm init -y
npm install express
npm install -D typescript tsx @types/express
npx tsc --init
Then uncomment rootDir and outDir and update it in your recent generated tsconfig.json.
add include["/src/**/.*ts"] and exclude["node_modues"] after compileroption
or simply Update your tsconfig.json with this:
{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"rootDir": "./",
"outDir": "./dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"strictPropertyInitialization": true,
"strictBuiltinIteratorReturn": true,
"alwaysStrict": true,
"useUnknownInCatchVariables": true
},
"files": [
"./app.ts",
"./server.ts"
],
"include": [
"*.ts"
],
"exclude": [
"node_modules"
]
}
Don’t worry about ESM configuration — tsx handles it.
4. Update your package.json scripts:
"scripts": {
"dev": "tsx watch src/server.ts",
"build": "tsc",
"start": "node dist/server.js"
}
✅ That’s it! You’ve got a fast, clean, modern TypeScript + Express setup — no hacks, no headaches.
Want a copy of my starter template?
Drop a comment or DM — happy to share it!
Mar 18, 2025
May 13, 2025
By signing up, you agree to our Privacy Policy