Blog.

Switched from ts-node-dev to tsx — Never Going Back

Yves DC

May 13, 2025

Switched from ts-node-dev to tsx — Never Going Back Image

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)

1. Initialize your project:


npm init -y


2. Install your dependencies:


npm install express

npm install -D typescript tsx @types/express


3. Create a tsconfig.json:


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!

Blog.

Hello, We're content writer who is fascinated by content fashion, celebrity and lifestyle.
We helps clients bring the right content to the right people.

Newsletter

Join 10k+ subscribers!

By signing up, you agree to our Privacy Policy