-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
react-scripts 5.0.0 build does not split resulting JavaScript bundle #11963
Comments
This appears to be resolved by #11763. |
The cited solution (#11763) has not been merged yet, so reopening this. We are having to use a patched version of this distribution for our builds. |
In case this helps anyone, I'm currently using react-app-rewired to override the Webpack config. It might not be worth it if you're not already using react-app-rewired in your project (I already was), but your module.exports = function override(config, webpackEnv) {
config.optimization.splitChunks =
webpackEnv === "development"
? undefined
: {
chunks: "all",
};
return config;
}; |
Is there any issue specified regarding this in webpack repo? or any response from webpack team? Above one would not be permanent solution I guess |
I have the opposite problem, on version 5.0.1 I have an assembly with chunks and I can't remove them. |
Describe the bug
After upgrading the
react-scripts
package from 4.0.3 to 5.0.0, thereact-scripts build
command only produces a single JavaScript file, where previously there were 3 files. Because of this, the resulting.js.map
file is too large for us to version-control.Did you try recovering your dependencies?
I have run the commands side-by-side in different copies of our source repository and confirmed that the RS 5.0.0 code is not producing comparable results to 4.0.3. In both trees, I was running against a clean re-install of all dependencies (removed
node_modules
and re-ranyarn install
).Which terms did you search for in User Guide?
I searched for "code splitting" and read the section on it. It implies that code-splitting is based on dynamic imports (which we are not using), but the application code itself has not changed (only the build tools).
Environment
Steps to reproduce
I'm not sure how to describe reproducing the problem, and I cannot share the project's
package.json
file as it is an internal company project.Expected behavior
I expected it to behave identically to the 4.0.3 toolchain.
Actual behavior
When I run
react-scripts build
on the repo that has version 4.0.3, the resultingbuild/static/js
directory looks like this:When I run the repo with the 5.0.0 toolchain, the resulting directory looks like this:
Reproducible demo
I cannot, as this is an internal company application.
The text was updated successfully, but these errors were encountered: