Registry / devops / typescript-build

typescript-build

JSON →
library3.1.0jsnpmunverified

Extends the TypeScript compiler (tsc) with a configurable file copy step, allowing you to copy non-TypeScript assets (CSS, JSON, etc.) from source to output directories after a successful tsc build. Current stable version is 3.1.0. It operates in two modes: TSC mode (runs tsc with given arguments and then copies files) or Copy-only mode (only copies files based on tsbconfig.json). Key differentiator: it automatically follows TypeScript project references, looking for tsbconfig.json next to each referenced tsconfig.json. Requires Node >=14.16 and a peer dependency on typescript itself.

npm install typescript-build
INSTALL
IMPORT
SIG · TYPESCRIPT-BUILD
T
typescript-build
devopsjavascriptv3.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tsb (CLI command)
npx tsb --build
npx tsc --build
tsb is a CLI tool, not a library. Install as dev dependency and use via npx or npm scripts.

Installation, configuration (tsbconfig.json), and build command to copy .css files during TypeScript compilation.

// 1. Install npm install --save-dev typescript typescript-build // 2. Create tsbconfig.json at project root // { // "copyFiles": [ // { // "files": ["src/**/*.css"], // "outDirectories": ["dist"], // "up": 1 // } // ] // } // 3. Run build npx tsb --build // This runs tsc --build first, then copies matched .css files to dist/
typescript-build --version
Debug
Known issues
breakingv2.0.0 dropped support for Node < 10 and changed configuration format (was .tsbconfig, now tsbconfig.json).
fix
Migrate to tsbconfig.json and upgrade Node to >=10 (v3 requires >=14.16).
affects: <2.0.0
breakingv3.0.0 requires Node >=14.16 and dropped Node 10/12 support.
fix
Upgrade Node to >=14.16.
affects: <3.0.0
gotchaCopy step only runs when --build flag is provided. Without --build, tsb behaves exactly like tsc (no copying).
fix
Always include --build to trigger file copying.
affects: >=2.0.0
gotchaClean removes output directories entirely unless skipClean is true. This may delete files not produced by tsb.
fix
Set skipClean: true in tsbconfig.json to prevent deletion of output directories.
affects: >=2.0.0
deprecatedThe old configuration file format (.tsbconfig) was removed in v2.0.0.
fix
Rename .tsbconfig to tsbconfig.json and update content.
affects: <2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'typescript'
typescript is a peer dependency, not installed automatically.
fix
Run 'npm install --save-dev typescript' (or add it to peerDependencies).
tsb: error: unknown option `--watch'
tsb does not pass --watch to tsc; copy step only works with --build.
fix
Use 'tsb --build' for building, or run 'tsc --watch' directly for watch mode (copy not supported).
No tsbconfig.json found, skipping copy step.
tsbconfig.json is missing or not in the project root.
fix
Create tsbconfig.json at the same directory where you run tsb.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies
typescriptrequiredpeer dependency; tsb runs tsc under the hood
Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
typescript-build — npm install typescript-build · libregistry