compiler

tcmts.core.ts.compiler · #3bhtpeiv · term · runs on the server

uses process

The compiler process this process talks to, started on first use and kept for its life.

import { api, compilerBinary, keepByteOrderMarks } from "#codebase/tcmts/core/ts";
import { API } from "typescript/sync";

export function compiler(): API {
  if (!api) {
    api = new API({ cwd: process.cwd(), tsserverPath: compilerBinary() });
    keepByteOrderMarks((api as unknown as { decoder: object }).decoder);
  }
  return api;
}

uses

used by