Files
scriptc/packages/cli/src/bootstrap.ts
Chris Tate 988fae1245 Speed up scriptc builds
- Cache native compilation inputs and enable Node 24 bytecode caching
- Memoize frontend type lowering and reduce checker overfetch
- Add dev-mode library optimization and phase timing
2026-08-17 17:02:25 -05:00

17 lines
528 B
JavaScript

#!/usr/bin/env node
import { enableCompileCache } from "node:module";
// Node 24 can persist V8's compiled module bytecode. scriptc's CLI imports
// the compiler and its lowering/backend graph before handling any command, so
// enabling this in the tiny bootstrap avoids reparsing that graph on every
// edit/build invocation.
try {
enableCompileCache();
} catch {
// Bytecode caching is an optimization boundary. A read-only temp directory
// must never prevent the compiler from running.
}
await import("./main.js");