Skip to content

Don't use webpack multi entry unnecessarily - #8834

Merged
ianschmitz merged 1 commit into
react:masterfrom
sebmarkbage:avoidmultientry
Apr 15, 2020
Merged

Don't use webpack multi entry unnecessarily#8834
ianschmitz merged 1 commit into
react:masterfrom
sebmarkbage:avoidmultientry

Conversation

@sebmarkbage

Copy link
Copy Markdown
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

Copy link
Copy Markdown
Contributor

Good catch. Thanks @sebmarkbage!

@locklockBot locked and limited conversation to collaborators Apr 25, 2020
@ianschmitzianschmitz modified the milestones: 3.5, 4.0May 3, 2020
Sign up for freeto 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

@sebmarkbage@ianschmitz@facebook-github-bot