Skip to content
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

Don't use webpack multi entry unnecessarily #8834

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

sebmarkbage
Copy link
Contributor

Passing an array with a single entry is not equivalent. This causes Webpack to generate another wrapper module around the entry. This is just unnecessary overhead and bytes.

Before:

...
/***/ 10:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
...
/***/ }),

/***/ 5:
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(10);


/***/ })

},[[5,1,2]]]);

After:

...
/***/ 10:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
...
/***/ })

},[[10,1,2]]]);

Passing an array with a single entry is not equivalent. This causes Webpack
to generate another wrapper module around the entry. This is just
unnecessary overhead and bytes.
@ianschmitz ianschmitz added this to the 3.5 milestone Apr 15, 2020
@ianschmitz ianschmitz merged commit e89f153 into facebook:master Apr 15, 2020
@ianschmitz
Copy link
Contributor

Good catch. Thanks @sebmarkbage!

@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
@ianschmitz ianschmitz modified the milestones: 3.5, 4.0 May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants