Skip to content

Add more flexibility when using workspace feature #897

@jpzwarte

Description

@jpzwarte

Clear and concise description of the problem

Sometimes you have a bunch of packages in a workspace, but not all packages share the same exports. Example: you have a folder with a bunch of UI components and a "shared" package. That shared package is different from the others.

You can't have "optional entries": if you include an entrypoint and the shared package doesn't have it, it errors out.

At the moment i can work around that by either using the inputOptions callback or the exports.customExports callback.

Suggested solution

It would be nice if you could have package specific config options in package.json of that package. tsdown would then include those package specific options when building the package in the workspace. Perhaps something like:

"tsdown": {
  "exports": {
    "customExports": {
        "./foo.js": "./src/foo.js"
    }
  }
}

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions