Skip to content

exports.customExports should accept an object #767

@Joery-M

Description

@Joery-M

Clear and concise description of the problem

I believe exports.customExports should support an object as argument in addition to a function.

It feels a bit excessive to have to use a function to define one or two extra exports.

Suggested solution

import { defineConfig } from "tsdown";

export default defineConfig({
    entry: "./src/index.ts",
    copy: ["./src/binding/worker.wasm"],
    exports: {
        customExports: {
            "./worker.wasm": "./dist/worker.wasm",
        },
    },
});

Alternative

In my specific use-case it could also be possible to allow any files that were copied using copy to have exports generated.

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions