Unverified Commit ee152079 authored by Luke Sandberg's avatar Luke Sandberg Committed by GitHub

[turbopack] tweak the doc on the inner graph optimization (#84752)

This optimization is enabled by default and we already link to the docs so referencing the configuration option is more misleading than helpful.

Fixes https://github.com/vercel/feedback/issues/111264
parent bc51d9bb
...@@ -134,7 +134,7 @@ This can lead to subtle rendering changes when adopting Turbopack, if applicatio ...@@ -134,7 +134,7 @@ This can lead to subtle rendering changes when adopting Turbopack, if applicatio
### Bundle Sizes ### Bundle Sizes
Turbopack does not yet have an equivalent to the [Inner Graph Optimization](https://webpack.js.org/configuration/optimization/#optimizationinnergraph) in webpack. This optimization is useful to tree shake large modules. For example: Turbopack does not yet have an equivalent to the [Inner Graph Optimization](https://webpack.js.org/configuration/optimization/#optimizationinnergraph) in webpack which is enabled by default. This optimization is useful to tree shake large modules. For example:
```js filename=large.module.js ```js filename=large.module.js
import heavy from 'some-heavy-dependency.js' import heavy from 'some-heavy-dependency.js'
...@@ -146,9 +146,9 @@ export function usesHeavy() { ...@@ -146,9 +146,9 @@ export function usesHeavy() {
export const CONSTANT_VALUE = 3 export const CONSTANT_VALUE = 3
``` ```
If an application only uses `CONSTANT_VALUE` Turbopack will detect this and delete the `usesHeavy` export but not the corresponding `import`. However, with the `optimization.innerGraph = true` option enabled, webpack can delete the `import` too. If an application only uses `CONSTANT_VALUE` Turbopack will detect this and delete the `usesHeavy` export but not the corresponding `import`. However, with the Inner Graph Optimization, webpack can delete the `import` too which can drop the dependency as well.
We are planning to offer an equivalent to the `innerGraph` optimization in Turbopack but it is still under development. If you are affected by this gap, consider manually splitting these modules. We are planning to offer an equivalent to the Inner Graph Optimization in Turbopack but it is still under development. If you are affected by this gap, consider manually splitting these modules.
### Build Caching ### Build Caching
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment