typescript-cached-transpile is a utility designed to accelerate TypeScript compilation in `transpileOnly` mode by monkey-patching the `typescript` compiler's `transpileModule` function to utilize a disk cache. It is currently at version 0.0.6, indicating an early development stage, and its release cadence is likely tied to the maintainer's personal monorepo updates. Its primary differentiator is its targeted optimization for `ts-node`'s `transpileOnly` mode, significantly reducing build times for repetitive compilations of unchanged files by persisting transpilation results to disk. It transparently integrates by being specified as `ts-node`'s compiler, and offers configuration via environment variables or a custom JS file for cache directory and portable cache settings. It explicitly states limitations, such as not working with transformers, diagnostics, or type-checking.
npm install typescript-cached-transpileVerified import paths — ran on the pinned version, not inferred.
Demonstrates the command-line usage of `typescript-cached-transpile` with `ts-node` for faster `transpileOnly` execution, including how to use a custom compiler file and specify a cache directory.
Review the README's requirements list and ensure your `ts-node` configuration adheres to them. Use `tsc --noEmit` for type-checking separately.
Be aware of potential interactions with other tools or plugins that modify TypeScript's compiler. Isolate its usage if conflicts arise.
Always set `TS_CACHED_TRANSPILE_PORTABLE=true` when creating or consuming a cache intended for distribution or relocation. Ensure cache directory paths are absolute (e.g., `$PWD/.cache`).
Monitor `ts-node` and `typescript` updates for breaking changes to their compiler API or custom compiler integration points. Be prepared for potential refactoring if underlying APIs change.
Run `npm install typescript-cached-transpile` or `yarn add typescript-cached-transpile`.
Use CommonJS syntax: `const { create } = require('typescript-cached-transpile');`Verify that no transformers are used, no diagnostics are returned, sourcemaps are enabled, and the config object and source code remain consistent. Ensure you are not relying on type-checking, which this package does not accelerate.