🚀 Feature: Dynamically computed tsup entry value #1931
Labels
status: in discussion
Not yet ready for implementation or a pull request
type: feature
New enhancement or request
Bug Report Checklist
main
branch of the repository.Overview
Splitting out of #1910: right now, the TSup config includes all
src/**/*.ts
files except test files:create-typescript-app/tsup.config.ts
Line 7 in 21b4be0
That presents an edge case for test utility files with names like
data.fakes.ts
. They're not excluded by the!src/**/*.test.*
, and so are included by thesrc/**/*.ts
- even though they shouldn't be in the output package. As a result I've been less willing to write files like that.The tsup config could in theory be expanded to exclude files with known names like
*.fakes.*
......but then that establishes a convention that not every package already uses. -1 from me.
I think what we really need here is an
entry
that respectspackage.json
exports
/main
. I think that could be achieved with some kind of helper library used like:Additional Info
I see this as kind of an intermediate step in lieu of / towards #1910. This wouldn't solve the issues around tsup falling out of maintenance. But it would solve the specific issue of out-of-entrypoints modules still being included.
Putting in
status: in discussion
for a bit to let the idea settle. I'm also asking around about #1910 on social media: https://bsky.app/profile/joshuakgoldberg.com/post/3lhgppvnyjc2e, https://fosstodon.org/@JoshuaKGoldberg/113951603816733558.💖
The text was updated successfully, but these errors were encountered: