Skip to content

Commit 70e7dbc

Browse files
authored
docs(guides): clarify SplitChunksPlugin behavior (#7275)
1 parent bedb85b commit 70e7dbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/content/guides/code-splitting.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ The [`SplitChunksPlugin`](/plugins/split-chunks-plugin/) allows us to extract co
236236
};
237237
```
238238

239-
With the [`optimization.splitChunks`](/plugins/split-chunks-plugin/#optimizationsplitchunks) configuration option in place, we should now see the duplicate dependency removed from our `index.bundle.js` and `another.bundle.js`. The plugin should notice that we've separated `lodash` out to a separate chunk and remove the dead weight from our main bundle. Let's do an `npm run build` to see if it worked:
239+
With the [`optimization.splitChunks`](/plugins/split-chunks-plugin/#optimizationsplitchunks) configuration option in place, we should now see the duplicate dependency removed from our `index.bundle.js` and `another.bundle.js`. The plugin should notice that we've separated `lodash` out to a separate chunk and remove the dead weight from our main bundle. However, it's important to note that common dependencies are only extracted into a separate chunk if they meet the [size thresholds](/plugins/split-chunks-plugin/#splitchunksminsize) specified by webpack.
240+
241+
Let's do an `npm run build` to see if it worked:
240242

241243
```bash
242244
...

0 commit comments

Comments
 (0)