Topic: Create builds with rollup instead of webpack
As for now, webpack doesn't have the ability to generate output in ES module format (https://github.com/webpack/webpack/issues/2933). Because of that, when importing mdbreact webpack tree shakedown doesn't work, so final bundle contains the entirety of both mdbreact and @material-ui.
Quick POC allowed to reduce my minified production bundle by 426862 bytes, which is 27% of whole vendor bundle. Admittedly, we are using only a handful of components in our project, but I doubt anyone is ever using everything.
Could you please consider update to package building process?
Here is an issue on your git: https://git.mdbootstrap.com/mdb/react/re-pro/issues/41 with the sample diff
Jakub Mandra staff premium answered 6 years ago
Thank you so much!
Actually we're getting rid of external dependencies, so material-ui will soon disappear.
Of course we are going to bring up the full functionality of tree shaking, so your suggestion is very helpful.
We will come back with feedback when we test that.
Take care and keep hacking! :)
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB React
- MDB Version: 4.7.1
- Device: Desktop
- Browser: Chrome
- OS: Ubuntu
- Provided sample code: No
- Provided link: No
bgining2this commented 6 years ago
I am using MDB with react and rollup with no problems, do you want to see some of my setup?
Jakub Mandra staff premium commented 6 years ago
Hi,
If you would be so nice, we will be happy to see your setup (maybe we will find there something usefull).
We already worked on it and will release next version with Rollup as a production module bundler. It rocks!
Best,
Jakub