This episode covers tooling and build automation in NestJS: the Nest CLI, TypeScript compiler, and ts-node; build pipelines with npm and Docker; static analysis, linting, and formatting; plus reproducible builds and multi-environment setup.

The right tools make development faster and safer. NestJS ships with a complete toolchain: the Nest CLI, TypeScript, ESLint, Prettier, and an automated build pipeline. Episode 19 covers modern tooling and build automation.
You'll understand how each tool works and how to put together a reproducible build pipeline.
The Nest CLI is the primary tool for NestJS development:
nest --helpImportant commands: nest new for new projects, nest generate (alias nest g) for creating modules, controllers, services, and more. The CLI also builds and runs the application.
NestJS projects use tsc to compile TypeScript into JavaScript:
nest buildnest build runs the TypeScript compiler and puts the output in the dist folder. The tsconfig.json file controls compilation behavior — module resolution, ES target, and strict mode.
ts-node runs TypeScript directly without a full compile:
npm run start:devThe start:dev command uses nest start --watch, which combines incremental compilation and automatic restart when files change — making the development loop fast.
package.json defines the build and run scripts:
{
"scripts": {
"build": "nest build",
"start": "nest start",
"start:dev": "nest start --watch",
"start:prod": "node dist/main.js",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"format": "prettier --write \"src/**/*.ts\""
}
}A standard build pipeline: npm run build for compilation, npm run lint for quality checks, then npm run start:prod to run the build output.
For deployment, the build happens inside Docker. A multi-stage image compiles, then copies the result into a small runtime image. Full details are in episode 20 — the key point here: builds must be reproducible, meaning the result is identical on any machine.
ESLint is a static analysis tool that catches bugs and style violations:
npm run lintNestJS uses an ESLint configuration from eslint-config-next-style TypeScript. Linting can run in CI to block merging problematic code.
Prettier formats code consistently:
npm run formatWith Prettier, the whole team writes identical formatting — eliminating style debates and keeping Git diffs cleaner.
strict: true in tsconfig.json enables strict type checking. This catches many potential bugs at compile time, before the code reaches production.
Reproducibility starts with locked dependencies:
package-lock.jsonThe lockfile records the exact version of every dependency. With npm ci, installation is always identical to what's recorded in the lockfile — eliminating "works on my machine but fails in CI" surprises.
One codebase, many environments: development, staging, and production. Each environment uses different configuration values (see episode 8) but identical code and dependencies. The same build can be promoted from staging to production without rebuilding — that's the power of reproducible builds.
Episode 19 strengthens your toolchain: the Nest CLI, TypeScript compiler, ts-node, npm and Docker build pipelines, static analysis, linting, formatting, and reproducible builds.
Key takeaways:
nest build compiles TypeScript into dist.nest start --watch provides a fast development loop.npm ci guarantee identical installs.In the next episode 20 we'll discuss containerization and cloud deployment — Dockerizing your NestJS application, Kubernetes deployment and health checks, serverless with AWS Lambda or Cloud Functions, and cloud provider integration with AWS, GCP, and Azure.