Tree-shaking documentation isn't clear enough.
wujekbogdan opened this issue · comments
wujekbogdan commented
The docs say that tree-shaking is enabled by default. It also says that setting it to true
makes tsup use Rollup, rather than ESBuild, for tree-shaking. What's missing from the docs is:
- What happens if
treeshake
is set tofalse
? Does it disable tree-shaking entirely, or is it an equivalent oftreeshake: undefined
, which effectively turns it on but uses ESBuild rather than Rollup? - Does setting
treeshake
totrue
make the build process use Rollup for the entire build, or is Rollup somehow used for tree-shaking only?
I wonder if this is an issue with the docs or rather an issue with the API.
How about adding a new config property treeshakeType
:
type TreeshakeType = 'rollup' | 'esbuild'
Then the current treeshake
property would either accept a boolean (if treeshakeType : 'esbuild'
) or TreeshakingOptions
(if treeshakeType: 'rollup'
)
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.