These MUI packages introduce a large amount of unnecessary code into downstream projects, mainly because the icon package is imported as global dependency. As a result, my final index.js increased by more than 1 MB even after gzip.
Root cause:
"@mui/icons-material": "^5.10.9",
"@mui/material": "^5.15.10",
"@mui/system": "^5.15.9"
They are also required as peer dependencies in the widely used identity-react library:
"@mui/icons-material": ">=5.0.0",
"@mui/material": ">=5.0.0"
https://github.com/bsv-blockchain/identity-react
This effectively forces projects to include the full MUI bundle — even if only a tiny portion is needed, especially the icons.
Possible mitigation:
Import only the components or icons you actually need, or replace the MUI icon set with lighter, on-demand alternatives. This helps avoid pulling in the entire icon library globally.
These MUI packages introduce a large amount of unnecessary code into downstream projects, mainly because the icon package is imported as global dependency. As a result, my final
index.jsincreased by more than 1 MB even after gzip.Root cause:
They are also required as peer dependencies in the widely used
identity-reactlibrary:https://github.com/bsv-blockchain/identity-react
This effectively forces projects to include the full MUI bundle — even if only a tiny portion is needed, especially the icons.
Possible mitigation:
Import only the components or icons you actually need, or replace the MUI icon set with lighter, on-demand alternatives. This helps avoid pulling in the entire icon library globally.