-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
548a7bf
Minor Documentation Clean Up
jacobangel 779084b
Lower the case
jacobangel a2009f8
Merge branch 'master' into patch-1
jacobangel 89b3202
Merge branch 'master' into patch-1
jacobangel 85ea5a9
Merge branch 'master' into patch-1
jacobangel 39f77b1
Merge branch 'master' into patch-1
montogeek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ contributors: | |
- chrisdothtml | ||
- EugeneHlushko | ||
- byzyk | ||
- jacobangel | ||
- madhavarshney | ||
- sakhisheikh | ||
related: | ||
|
@@ -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. | ||
|
||
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: | ||
|
||
|
@@ -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` | ||
|
||
|
@@ -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 = { | ||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this really a thing? |
||
|
||
```js | ||
module.exports = { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
😕There was a problem hiding this comment.
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.