콘텐츠로 이동

TsconfigCache

Defined in: core/index.ts:393

tsconfig autodiscover walk 결과 캐시 (#2367). 다수 파일을 in-process 반복 transpile 하는 NAPI consumer (Vite/Rollup plugin 등) 가 인스턴스 1 회 생성해 transpile 호출들에 재사용 → file 당 5–10 fs syscall 절약.

transpile()cache 옵션으로 패스. tsconfigPath / tsconfigRaw 가 명시되면 캐시는 무시되고 명시 값 사용. 인스턴스는 GC 시 자동 cleanup — 명시 dispose 불필요.

rolldown TsconfigCache 와 정합 (디자인은 1-slot 이 아니라 N-slot HashMap).

const cache = new TsconfigCache();
for (const file of files) {
transpile(source, { filename: file, cache });
}

new TsconfigCache(): TsconfigCache

Defined in: core/index.ts:397

TsconfigCache

get size(): number

Defined in: core/index.ts:408

현재 캐시된 entry 수 (테스트 / 디버깅).

number

[dispose](): void

Defined in: core/index.ts:417

Explicit Resource Management (TC39 Stage 4) — using cache = new TsconfigCache(); 스코프 종료 시 자동 clear(). 메모리 자체는 GC finalizer 가 회수하므로 본 메서드는 “cache 비움” 만 수행 (인스턴스 재사용 가능).

void


clear(): void

Defined in: core/index.ts:403

모든 cache entry 와 내부 string 메모리 회수. 인스턴스는 재사용 가능.

void