TsconfigCache
This content is not available in your language yet.
Defined in: core/index.ts:488
Cache of tsconfig autodiscovery walk results (#2367). A NAPI consumer that repeatedly transpiles many files in-process (Vite/Rollup plugin, etc.) creates one instance and reuses it across transpile calls → saves 5–10 fs syscalls per file.
Passed via the cache option of transpile(). When tsconfigPath /
tsconfigRaw is specified, the cache is bypassed and the explicit value is
used. The instance is cleaned up automatically on GC — explicit dispose is
not required.
Aligned with rolldown TsconfigCache (the design is an N-slot HashMap, not
a single slot).
Example
섹션 제목: “Example”const cache = new TsconfigCache(); for (const file of files) { transpile(source, { filename: file, cache }); }Constructors
섹션 제목: “Constructors”Constructor
섹션 제목: “Constructor”new TsconfigCache():
TsconfigCache
Defined in: core/index.ts:492
Returns
섹션 제목: “Returns”TsconfigCache
Accessors
섹션 제목: “Accessors”size
섹션 제목: “size”Get Signature
섹션 제목: “Get Signature”get size():
number
Defined in: core/index.ts:502
Current number of cached entries (testing / debugging).
Returns
섹션 제목: “Returns”number
Methods
섹션 제목: “Methods”[dispose]()
섹션 제목: “[dispose]()”[dispose]():
void
Defined in: core/index.ts:512
Explicit Resource Management (TC39 Stage 4) — using cache = new TsconfigCache();
automatically calls clear() on scope exit. The memory itself is reclaimed
by the GC finalizer, so this method only “empties the cache” (the instance
can be reused).
Returns
섹션 제목: “Returns”void
clear()
섹션 제목: “clear()”clear():
void
Defined in: core/index.ts:497
Reclaims all cache entries and internal string memory. The instance can be reused.
Returns
섹션 제목: “Returns”void