Skip to content

[Docs] workspace field requires entry to work, but this is not documented #941

@Bryasxin

Description

@Bryasxin

Clear and concise description of the problem

As a developer using tsdown, I want the documentation to clarify that when the workspace option is used, a root-level entry must also be provided. Currently, without a root entry, the build fails with an error, but the documentation does not mention this requirement.

Example of what currently causes an error (only workspace configured, no root entry):

export default defineConfig({
  workspace: "package/*",
});

Error output:

ERROR  Error: No valid configuration found.
    at resolveConfig (...)
    at async build$1 (..)
    at async CAC.<anonymous> (...)
    at async runCLI (...)

However, the correct usage (adding a root entry) works but is not documented:

export default defineConfig({
  entry: ["src/index.ts"],
  workspace: "package/*",
});

Suggested solution

In the documentation page for the workspace option, add an explicit note explaining the requirement, for example:

Important: When using workspace, you must also define a root entry (e.g., entry: ["src/index.ts"]). The root entry is required for the workspace build to start; without it, tsdown will throw a No valid configuration found error.

Also include the correct code example with both entry and workspace to guide users.

Alternative

One alternative is to change tsdown's behavior so that workspace alone is sufficient (e.g., automatically use a default entry). That would be a code change, not documentation. The current documentation-only fix is to explain the requirement clearly.

Additional context

This issue was discovered during real usage of tsdown (v0.11.10). After searching existing issues, no similar documentation gap was found. The requirement for a root entry is non-obvious and leads to a cryptic error without documentation.

Notably, the official skill examples include a workspace config with an entry field, yet the documentation never states that entry is required for workspace to work.

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