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

    Hierarchy (View Summary)

    Index

    Properties

    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.

    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.

    resolve?: boolean | (string | RegExp)[]

    Controls whether type definitions from node_modules are bundled into your final .d.ts file or kept as external import statements.

    By default, dependencies are external, resulting in import { Type } from 'some-package'. When bundled, this import is removed, and the type definitions from some-package are copied directly into your file.

    • true: Bundles all dependencies.
    • false: (Default) Keeps all dependencies external.
    • (string | RegExp)[]: Bundles only dependencies matching the provided strings or regular expressions (e.g. ['pkg-a', /^@scope//]).
    resolver?: "oxc" | "tsc"

    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.