Skip to content

Commit 358dc73

Browse files
committed
docs: clarify treeshake option behavior
Explain that the Rollup pass only post-processes esbuild's output for extra tree shaking rather than replacing esbuild for the whole build, and that treeshake: false simply skips that pass since esbuild's own tree shaking always runs and can't be disabled.
1 parent b6bcae8 commit 358dc73

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ export default defineConfig({
501501

502502
This option has the same type as the `treeshake` option in Rollup, [see more](https://rollupjs.org/guide/en/#treeshake).
503503

504+
Note that this Rollup pass only post-processes the code esbuild already emitted to remove additional dead code — esbuild is still used to bundle the rest of the build. Setting `treeshake` to `false` (the default) simply skips this extra Rollup pass; esbuild's own built-in tree shaking still runs regardless of this option, since it can't be disabled.
505+
504506
### What about type checking?
505507

506508
esbuild is fast because it doesn't perform any type checking, you already get type checking from your IDE like VS Code or WebStorm.

0 commit comments

Comments
 (0)