By default tsup bundles all imported modules but dependencies and peerDependencies in package.json are always excluded.
I believe that optionalDependencies should be also excluded by default, as they are essentially the dependencies which are simply allowed to not exist, and the library author is supposed to import them dynamically and handle failed imports gracefully.
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
By default tsup bundles all imported modules but
dependencies
andpeerDependencies
inpackage.json
are always excluded.I believe that
optionalDependencies
should be also excluded by default, as they are essentially thedependencies
which are simply allowed to not exist, and the library author is supposed to import them dynamically and handle failed imports gracefully.Upvote & Fund