banira
    Preparing search index...

    Class Compiler

    Compiler class for compiling TypeScript files

    This class provides functionality to compile TypeScript files using either the standard filesystem or a virtual filesystem (memfs).

    // Using standard filesystem (library default compiler options)
    const compiler = new Compiler(['src/file.ts']);
    compiler.emit();

    // With custom options
    const compiler = new Compiler(['src/file.ts'], { outDir: 'dist' });
    compiler.emit();

    // Using virtual filesystem
    const compiler = await Compiler.withVirtualFs(['src/file.ts'], { outDir: 'dist' });
    compiler.emit();
    Index

    Constructors

    Properties

    defaultTransformers: CustomTransformers

    Default transformers for the compiler

    fileNames: string[]

    Array of file paths to compile

    host?: CompilerHost

    Compiler host

    options: CompilerOptions

    TypeScript compiler options

    DEFAULT_COMPILER_OPTIONS: CompilerOptions = ...

    Default compiler options for the TypeScript compiler

    Methods

    • Creates a Compiler instance that uses a virtual filesystem

      Parameters

      • fileNames: string[]

        Array of file paths to compile

      • options: CompilerOptions

        TypeScript compiler options

      Returns Promise<Compiler>

      A Promise that resolves to a new Compiler instance