esbuild-node-tsc is a CLI tool designed to rapidly build TypeScript Node.js projects leveraging the performance of esbuild. Currently at version 2.0.5, the project maintains an active release cadence, frequently updating dependencies and introducing minor features or fixes. Its primary function is to interpret tsconfig.json options and apply them via esbuild, offering significantly faster build times compared to tsc or ts-node for development workflows. A key differentiator is its focus on build speed rather than type-checking, which it explicitly offloads to tsc. It provides prebuild and postbuild hooks for custom operations like cleaning output directories or copying non-TypeScript assets, which became the standard approach since version 2.0.0, replacing automatic file copying.
npm install esbuild-node-tscVerified import paths — ran on the pinned version, not inferred.
Demonstrates setting up esbuild-node-tsc for a TypeScript Node.js project with live reloading using nodemon, including custom prebuild/postbuild hooks for cleaning the dist folder and copying non-TypeScript assets like `.graphql` and `.json` files. This setup enables rapid development feedback loops.
Migrate to using 'prebuild' and 'postbuild' hooks in 'etsc.config.js'. Install 'cpy' and 'rimraf' as dev dependencies if needed for these hooks (e.g., `npm install --save-dev cpy rimraf`).
Run 'tsc --noEmit' in parallel or as a separate step in your build process (e.g., in `package.json` scripts) to ensure type safety. For example, `npm run build && tsc --noEmit`.
Ensure both 'esbuild' and 'typescript' are installed as dev dependencies: `npm install --save-dev esbuild typescript`.
Review the 'esbuild' options in your 'etsc.config.js' and consult the esbuild documentation to understand their implications, ensuring they align with your desired build behavior and 'tsconfig.json' settings.
Run `npm install --save-dev esbuild` to install the esbuild package locally.
Ensure `esbuild-node-tsc` is installed via `npm install --save-dev esbuild-node-tsc` and execute it using `npx etsc` or via a `package.json` script (e.g., `npm run dev`).
Ensure 'rimraf' and 'cpy' are installed as dev dependencies. For 'etsc.config.js' hooks, use dynamic `await import('module')` as shown in the package's documentation to load ESM modules correctly.Integrate a separate step for type checking using `tsc --noEmit` into your development or CI/CD workflow to validate types independently of the build process.