Skip to content

Add support for target: baseline-widely-available similar to Vite #893

@amanmahajan7

Description

@amanmahajan7

Clear and concise description of the problem

As a developer using tsdown for browser-targeted packages, I want a baseline-widely-available target option so that I don’t have to hardcode and maintain browser version floors manually.

Right now I have to use explicit targets like:

target: ['chrome117', 'edge117', 'firefox116', 'safari17']

and the same again for CSS:

css: {
  target: ['chrome117', 'edge117', 'firefox116', 'safari17']
}

This works, but it gets stale over time and makes config harder to maintain. Vite already supports build.target: "baseline-widely-available", and a similar option in tsdown would make browser-library configs simpler and clearer.

Suggested solution

In the target option, support a string alias such as:

target: 'baseline-widely-available'
and ideally also allow the same value for:

css: {
  target: 'baseline-widely-available'
}

Implementation-wise, this could map internally to a maintained browser target set, similar in spirit to Vite’s behavior.

Alternative

Continue using explicit browser targets in user config.

Example:

target: ['chrome117', 'edge117', 'firefox116', 'safari17'],
css: {
  target: ['chrome117', 'edge117', 'firefox116', 'safari17']
}

This is workable, but it puts the maintenance burden on users and makes the intent less obvious.

Additional context

This would be especially helpful in projects using both Vite and tsdown, since it would align the mental model between the two tools.

Relevant Vite docs:
https://vite.dev/config/build-options#build-target

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    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