Skip to content

Commit

Permalink
docs(guides): clarify SplitChunksPlugin behavior (#7275)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 authored Jun 5, 2024
1 parent bedb85b commit 70e7dbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content/guides/code-splitting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ The [`SplitChunksPlugin`](/plugins/split-chunks-plugin/) allows us to extract co
};
```

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:
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.

Let's do an `npm run build` to see if it worked:

```bash
...
Expand Down

0 comments on commit 70e7dbc

Please sign in to comment.