splitChunks disabled by default in webpack 5 #12627
Unanswered
viyatgandhi
asked this question in
Q&A
Replies: 1 comment
-
This PR for adding 5 lines has been sitting there for 9 months. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
react version: 18.1.0
webpack version: 5.64.4
react-scripts: 5.0.1
From the docs of react (https://create-react-app.dev/docs/production-build/) it seems logical to have
splitChunks
enabled by default in webpack config but latest config (https://github.com/facebook/create-react-app/blob/main/packages/react-scripts/config/webpack.config.js) does not have splitChunks enabled.Is there a reason why it is not set? From performance perspective it seems logical to have vendor chunks separated from main application code.
with default webpack config as above:
After adding below piece of attributes in webpack config (ref from:
create-react-app/packages/react-scripts/config/webpack.config.prod.js
Line 161 in 52449c3
It generates below files which makes more sense:
Beta Was this translation helpful? Give feedback.
All reactions