docs: clarify array entry behavior with examples#7767
Open
alwaysalearner1234 wants to merge 3 commits intowebpack:mainfrom
Open
docs: clarify array entry behavior with examples#7767alwaysalearner1234 wants to merge 3 commits intowebpack:mainfrom
alwaysalearner1234 wants to merge 3 commits intowebpack:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| **Why?** In a multi-page application, the server is going to fetch a new HTML document for you. The page reloads this new document and assets are redownloaded. However, this gives us the unique opportunity to do things like using [`optimization.splitChunks`](/configuration/optimization/#optimizationsplitchunks) to create bundles of shared application code between each page. Multi-page applications that reuse a lot of code/modules between entry points can greatly benefit from these techniques, as the number of entry points increases. | ||
|
|
||
| T> As a rule of thumb: Use exactly one entry point for each HTML document. See the issue [described here](https://bundlers.tooling.report/code-splitting/multi-entry/#webpack) for more details. | ||
|
|
Member
There was a problem hiding this comment.
Please return this line
Updated code block formatting and clarified multi-main entry explanation.
Author
alwaysalearner1234
left a comment
There was a problem hiding this comment.
Thanks for the feedback! I’ve added the missing webpack.config.js code example for the array-based entry to keep the documentation consistent.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR improves the documentation for array entry usage by explaining
that it creates a single entry chunk and by adding common real-world
examples such as polyfills and development-only scripts.
Fixes #3788