UNPKG

typescript-transform-paths

Version:

Transforms module resolution paths using TypeScript path mapping and/or custom paths

10 lines (9 loc) 571 B
import type { TransformerExtras } from "ts-patch"; import ts from "typescript"; import { type TsTransformPathsConfig } from "./types.ts"; export default function transformer(program?: ts.Program, pluginConfig?: TsTransformPathsConfig, transformerExtras?: TransformerExtras, /** Supply if manually transforming with compiler API via 'transformNodes' / 'transformModule' */ manualTransformOptions?: { compilerOptions?: ts.CompilerOptions; fileNames?: string[]; }): (transformationContext: ts.TransformationContext) => (sourceFile: ts.SourceFile) => ts.SourceFile;