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
Clear and concise description of the problem
As a developer using tsdown for browser-targeted packages, I want a
baseline-widely-availabletarget option so that I don’t have to hardcode and maintain browser version floors manually.Right now I have to use explicit targets like:
and the same again for CSS:
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:
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:
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
Viteandtsdown, since it would align the mental model between the two tools.Relevant Vite docs:
https://vite.dev/config/build-options#build-target
Validations