KC's Workspace
    Preparing search index...
    interface ExportsOptions {
        all?: boolean;
        customExports?: (
            exports: Record<string, any>,
            context: { chunks: ChunksByFormat; isPublish: boolean; pkg: PackageJson },
        ) => Awaitable<Record<string, any>>;
        devExports?: string | boolean;
        exclude?: (string | RegExp)[];
        legacy?: boolean;
        packageJson?: boolean;
    }
    Index

    Properties

    all?: boolean

    Exports for all files.

    customExports?: (
        exports: Record<string, any>,
        context: { chunks: ChunksByFormat; isPublish: boolean; pkg: PackageJson },
    ) => Awaitable<Record<string, any>>
    devExports?: string | boolean

    Generate exports that link to source code during development.

    • string: add as a custom condition.
    • true: all conditions point to source files, and add dist exports to publishConfig.
    exclude?: (string | RegExp)[]

    Specifies file patterns (as glob patterns or regular expressions) to exclude from package exports. Use this to prevent certain files from being included in the exported package, such as test files, binaries, or internal utilities.

    Note: Do not include file extensions, and paths should be relative to the dist directory.

    exclude: ['cli', '**/*.test', /internal/]
    
    legacy?: boolean

    Generate legacy fields (main and module) for older Node.js and bundlers that do not support package exports field.

    Defaults to false, if only ESM builds are included, true otherwise.

    packageJson?: boolean

    Exports for package.json file.

    true