Skip to content

docs: clarify array entry behavior with examples#7767

Open
alwaysalearner1234 wants to merge 3 commits intowebpack:mainfrom
alwaysalearner1234:docs-array-entry
Open

docs: clarify array entry behavior with examples#7767
alwaysalearner1234 wants to merge 3 commits intowebpack:mainfrom
alwaysalearner1234:docs-array-entry

Conversation

@alwaysalearner1234
Copy link

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

@vercel
Copy link

vercel bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Feb 1, 2026 5:21pm

Request Review

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 28, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

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

Copy link
Member

Choose a reason for hiding this comment

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

Please return this line

Updated code block formatting and clarified multi-main entry explanation.
Copy link
Author

@alwaysalearner1234 alwaysalearner1234 left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback! I’ve added the missing webpack.config.js code example for the array-based entry to keep the documentation consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The behavior of entry is array should be described more specifically

2 participants