Skip to content

Commit efe88de

Browse files
authored
docs: improve tree-shaking description about mode
1 parent e0a2707 commit efe88de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/guides/tree-shaking.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ What we've learned is that in order to take advantage of _tree shaking_, you mus
361361
- Use ES2015 module syntax (i.e. `import` and `export`).
362362
- Ensure no compilers transform your ES2015 module syntax into CommonJS modules (this is the default behavior of the popular Babel preset @babel/preset-env - see the [documentation](https://babeljs.io/docs/en/babel-preset-env#modules) for more details).
363363
- Add a `"sideEffects"` property to your project's `package.json` file.
364-
- Use the [`production`](/configuration/mode/#mode-production) `mode` configuration option to enable [various optimizations](/configuration/mode/#usage) including minification and tree shaking.
364+
- Use the [`production`](/configuration/mode/#mode-production) `mode` configuration option to enable [various optimizations](/configuration/mode/#usage) including minification and tree shaking (side effects optimization is enabled in development mode using the flag value).
365365
- Make sure you set a correct value for [`devtool`](/configuration/devtool/#devtool) as some of them can't be used in `production` mode.
366366

367367
You can imagine your application as a tree. The source code and libraries you actually use represent the green, living leaves of the tree. Dead code represents the brown, dead leaves of the tree that are consumed by autumn. In order to get rid of the dead leaves, you have to shake the tree, causing them to fall.

0 commit comments

Comments
 (0)