REQUIRED_FOR_IMPORT

tcmts.core.program.REQUIRED_FOR_IMPORT · #lmfjz33t · term · runs anywhere

For importing existing code: tcm renders its own imports (by hash, with import type decided by tcm), so the project's resolution style doesn't matter, and most projects are written for bundler resolution: every file is ESM and relative imports can omit extensions. Only what Node's type stripping needs to run the code is forced.

import type { CompilerOptions } from "#codebase/tcmts/core/program";
import { ModuleKind as ts_ModuleKind, ModuleResolutionKind as ts_ModuleResolutionKind } from "typescript/sync";

export const REQUIRED_FOR_IMPORT: CompilerOptions = {
  module: ts_ModuleKind.ESNext,
  moduleResolution: ts_ModuleResolutionKind.Bundler,
  noEmit: true,
  // enums, namespaces and parameter properties are allowed: their modules are compiled when run
  erasableSyntaxOnly: false,
  allowImportingTsExtensions: true,
  verbatimModuleSyntax: false,
}

uses

used by