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 to false? Does it disable tree-shaking entirely, or is it an equivalent of treeshake: undefined, which effectively turns it on but uses ESBuild rather than Rollup?
Does setting treeshake to true 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.
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: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?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
:Then the current
treeshake
property would either accept a boolean (iftreeshakeType : 'esbuild'
) orTreeshakingOptions
(iftreeshakeType: 'rollup'
)Upvote & Fund