KEMBAR78
Don't use webpack multi entry unnecessarily by sebmarkbage · Pull Request #8834 · facebook/create-react-app · GitHub
Skip to content

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