TypeScript uses hereby, a modern task runner, to orchestrate its build process. The build is defined in Herebyfile.mjs and compiles TypeScript source code using itself (bootstrapping).
hereby local # Full build (default)hereby tsc # Command-line compilerhereby tsserver # Language serverhereby services # TypeScript API libraryhereby min # tsc + tsserver onlyhereby tests # Test infrastructure
hereby clean # Delete built fileshereby lint # Run ESLinthereby format # Format code with dprinthereby LKG # Update Last Known Goodhereby lib # Build library files
built/local/├── tsc.js # Compiler CLI├── _tsc.js # Compiler CLI (unwrapped)├── tsserver.js # Language server├── _tsserver.js # Language server (unwrapped)├── typescript.js # Public API├── typescript.d.ts # Public API types├── typescript.internal.d.ts # Internal API types├── tsserverlibrary.js # Language service library├── tsserverlibrary.d.ts # Language service types├── typingsInstaller.js # Automatic type acquisition├── watchGuard.js # File watching helper├── lib.*.d.ts # Standard library types└── *.js.map # Source maps
Alternatively, use npm scripts defined in package.json:
npm run build # Full buildnpm run build:compiler # Compiler onlynpm run build:tests # Test infrastructurenpm run clean # Clean outputsnpm run lint # Run linternpm run format # Format code
The npm scripts are wrappers around hereby tasks. Using hereby directly provides more options.