I am using Create-react-app for my application. When I run npm run build, my build size is 10.6 MB. When I used source-map-explorer to analyze i got know my node modules are taking 6.3 MB and my components takes 2.84 MB, 780 KB for static and other for containers and reducers.
Kindly help me to reduce my build size. Thanks in advance
It's painful!
You have multiple packages antd
, material-ui
, cpexcel
, froala-editor
...etc
These packages are awesome, but the problem is they are very large ones.
You can have these notes to be considered for reducing the bundle size:
package.json
CLEAN IT UP.import
statements in your application.These can bring major changes to your bundle size, depending on how much you put effort on them.
The other way might be ejecting the app, and customly set Webpack Configurations yourself to deal with the specifications of your project.