Skip to content

Minor SplitChunks Documentation Clean Up #2252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/content/plugins/split-chunks-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contributors:
- chrisdothtml
- EugeneHlushko
- byzyk
- jacobangel
- madhavarshney
- sakhisheikh
related:
Expand All @@ -23,9 +24,9 @@ Since webpack v4, the `CommonsChunkPlugin` was removed in favor of `optimization

## Defaults

Out of the box `SplitChunksPlugin` should work great for most users.
Out of the box `SplitChunksPlugin` should work well for most users.
Copy link
Member

@EugeneHlushko EugeneHlushko Jun 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels like it didnt work great for most users and we had to change to well 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, "well" reads as the more natural adverb in this sentence.


By default it only affects on-demand chunks because changing initial chunks would affect the script tags the HTML file should include to run the project.
By default it only affects on-demand chunks, because changing initial chunks would affect the script tags the HTML file should include to run the project.

webpack will automatically split chunks based on these conditions:

Expand All @@ -38,9 +39,9 @@ When trying to fulfill the last two conditions, bigger chunks are preferred.

## Configuration

For developers that want to have more control over this functionality, webpack provides a set of options to better fit your needs. If you're changing the configuration, it's a good idea to measure the impact of your changes to ensure there's a real benefit.
webpack provides a set of options for developers that want more control over this functionality.

W> Default configuration was chosen to fit web performance best practices but the optimum strategy for your project might defer depending on the nature of it.
W> The default configuration was chosen to fit web performance best practices, but the optimal strategy for your project might differ. If you're changing the configuration, you should measure the impact of your changes to ensure there's a real benefit.

## `optimization.splitChunks`

Expand Down Expand Up @@ -86,7 +87,7 @@ By default webpack will generate names using origin and name of the chunk (e.g.

`function` `string`

This indicates which chunks will be selected for optimization. If a string is provided, possible values are `all`, `async`, and `initial`. Providing `all` can be particularly powerful because it means that chunks can be shared even between async and non-async chunks.
This indicates which chunks will be selected for optimization. When a string is provided, valid values are `all`, `async`, and `initial`. Providing `all` can be particularly powerful, because it means that chunks can be shared even between async and non-async chunks.

```js
module.exports = {
Expand All @@ -100,7 +101,7 @@ module.exports = {
};
```

Alternatively, you can provide a function for more control. The return value will indicate whether to include each chunk.
Alternatively, you may provide a function for more control. The return value will indicate whether to include each chunk.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really a thing?


```js
module.exports = {
Expand Down