Skip to content
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

[material-ui] How to reduce bundle size? #42027

Open
swatinawale27 opened this issue Apr 26, 2024 · 3 comments
Open

[material-ui] How to reduce bundle size? #42027

swatinawale27 opened this issue Apr 26, 2024 · 3 comments
Assignees
Labels
package: material-ui Specific to @mui/material performance status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@swatinawale27
Copy link

swatinawale27 commented Apr 26, 2024

Steps to reproduce

Link to live example: (required)

Steps:
1.
2.
3.

Current behavior

No response

Expected behavior

No response

Context

We have react js application integrated with MUI. When application is deployed production on Kubernetes, we observed size of MUI packages taking more than 350mb space.
packages taking extra space are @mui, @mui/icons-material
version used :5

Can you please suggest how to reduce bundle size of MUI packages, i referred below link but didn't get much help. Top level imports are used in application e.g. "import { Button, TextField } from '@mui/material';"

https://mui.com/material-ui/guides/minimizing-bundle-size/

Your environment

No response

Search keywords: memory

@swatinawale27 swatinawale27 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 26, 2024
@zannager zannager added package: material-ui Specific to @mui/material support: question Community support but can be turned into an improvement labels Apr 26, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 26, 2024

350mb space.
packages taking extra space are https://github.com/mui, @mui/icons-material

Are you talking about disk space?

Can you please suggest how to reduce bundle size of MUI packages, i referred below link but didn't get much help. Top level imports are used in application e.g. "import { Button, TextField } from '@mui/material';" https://mui.com/material-ui/guides/minimizing-bundle-size/

Or are you talking about bundle size?

Memory utilization

Or are you talking about RAM usage?


My best guess is that "350mb space" means 350 KB gzipped. I doubt there is much to do about this that is Material UI specific. The usual tree shaking and code-splitting best practices should solve the problem.

@oliviertassinari oliviertassinari added performance and removed support: question Community support but can be turned into an improvement labels Apr 26, 2024
@swatinawale27
Copy link
Author

swatinawale27 commented Apr 29, 2024

When we install node_module docker image for the react js application on Kubernetes, @mui takes 170340 kb and @mui/icons-material takes 132948 kb disk space.

@danilo-leal danilo-leal changed the title Memory utilization [material-ui] How to reduce bundle size? Apr 29, 2024
@swatinawale27
Copy link
Author

Any solution to mentioned issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: material-ui Specific to @mui/material performance status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

4 participants