KC's Workspace
    Preparing search index...
    interface GeneralOptions {
        cjsDefault?: boolean;
        compilerOptions?: TsConfigJson.CompilerOptions;
        cwd?: string;
        dtsInput?: boolean;
        emitDtsOnly?: boolean;
        entry?: string | string[];
        generator?: "tsc" | "oxc" | "tsgo";
        logger?: Logger;
        resolver?: "tsc" | "oxc";
        sideEffects?: boolean;
        sourcemap?: boolean;
        tsconfig?: string | boolean;
        tsconfigRaw?: Omit<TsConfigJson, "compilerOptions">;
    }

    Hierarchy (View Summary)

    Index
    cjsDefault?: boolean

    Determines how the default export is emitted.

    If set to true, and you are only exporting a single item using export default ..., the output will use export = ... instead of the standard ES module syntax. This is useful for compatibility with CommonJS. This only controls the output format and does not enable support for CommonJS-style .d.ts input.

    compilerOptions?: TsConfigJson.CompilerOptions

    Override the compilerOptions specified in tsconfig.json.

    cwd?: string

    The directory in which the plugin will search for the tsconfig.json file.

    dtsInput?: boolean

    Set to true if your entry files are .d.ts files instead of .ts files.

    When enabled, the plugin will skip generating a .d.ts file for the entry point.

    emitDtsOnly?: boolean

    If true, the plugin will emit only .d.ts files and remove all other output chunks.

    This is especially useful when generating .d.ts files for the CommonJS format as part of a separate build step.

    Optionalentry

    entry?: string | string[]

    Glob pattern(s) to filter which entry files get .d.ts generation.

    When specified, only entry files matching these patterns will emit .d.ts chunks. When not specified, all entries get .d.ts generation.

    Supports negation patterns (e.g., ['**', '!src/icons/**']) for exclusion. Patterns are matched against file paths relative to cwd.

    entry: 'src/index.ts'
    entry: ['src/*.ts', '!src/internal/**']
    generator?: "tsc" | "oxc" | "tsgo"

    The generator used to produce .d.ts files.

    • 'tsc': The TypeScript 5.x/6.x compiler. Supports all TypeScript features.
    • 'oxc': Oxc's isolated declaration generator. Much faster than tsc, but only supports code that satisfies isolatedDeclarations.
    • 'tsgo': [Experimental] The TypeScript Go compiler (tsgo). May not support all TypeScript features yet.

    When unset, the generator is inferred:

    • 'oxc' if oxc options are provided or isolatedDeclarations is enabled in compilerOptions.
    • 'tsgo' if TypeScript 7.0 (or @typescript/native-preview) is installed, or tsgo options are provided.
    • 'tsc' otherwise, and always when vue is enabled.
    'tsc'
    
    logger?: Logger
    resolver?: "tsc" | "oxc"

    Specifies a resolver to resolve type definitions, especially for node_modules.

    • 'oxc': Uses Oxc's module resolution, which is faster and more efficient.
    • 'tsc': Uses TypeScript's native module resolution, which may be more compatible with complex setups, but slower.
    'oxc'
    
    sideEffects?: boolean

    Indicates whether the generated .d.ts files have side effects.

    • If set to true, Rolldown will treat the .d.ts files as having side effects during tree-shaking.
    • If set to false, Rolldown may consider the .d.ts files as side-effect-free, potentially removing them if they are not imported.
    false
    
    sourcemap?: boolean

    If true, the plugin will generate declaration maps (.d.ts.map) for .d.ts files.

    tsconfig?: string | boolean

    The path to the tsconfig.json file.

    If set to false, the plugin will ignore any tsconfig.json file. You can still specify compilerOptions directly in the options.

    'tsconfig.json'
    
    tsconfigRaw?: Omit<TsConfigJson, "compilerOptions">

    Pass a raw tsconfig.json object directly to the plugin.