Building and Deploying TypeScript Node.js Apps | NodeFlux.eu Docs
Compile TypeScript projects locally or in CI pipelines and run optimized JavaScript bundles on NodeFlux.
Steps
- Configure tsconfig.json with target "ES2022", module "NodeNext", and outDir "./dist".
- Add build script in package.json: "build": "tsc".
- Run npm run build locally or during deployment pipeline to output compiled JavaScript files into dist/.
- Ensure package.json includes "scripts": { "start": "node dist/index.js" }.
- Upload dist/, package.json, and package-lock.json to your NodeFlux application container.
- Start service and verify clean execution from compiled JavaScript outputs.
Notes
- Deploying pre-compiled JavaScript dist/ files reduces runtime memory overhead and eliminates typescript compiler startup delays.
- ts-node can be used for development, but compiled JS is strongly recommended for production runtime.
Related NodeFlux pages
- Setting Up CORS and Web Application Security Headers — Configure Cross-Origin Resource Sharing (CORS) and Helmet security headers on Node.js web services.
- Deploy a Node.js bot — Run lightweight Discord bots, automation scripts, or event workers.
- Diagnosing and Fixing Node.js Memory Leaks — Identify uncollected object references, event listener leaks, and global state accumulation in JavaScript.