Mui bundle size?

Hello,

I have a problem with mui lib that is taking almost 2.5MB of my bundle size

I only have named import like this import X from "@mui/material/X" and also setup in my .babelrc file

[
      "babel-plugin-direct-import",
      {
        "modules": ["@mui/material", "@mui/icons-material"]
      }
    ],

I do not know what I am missing ?

Thanks

You shouldn’t need to do both (direct import plugin and named imports directly manually). Also I usually use this plugin instead:

{
  "plugins": [
    [
      "transform-imports",
      {
        "@fortawesome/free-solid-svg-icons": {
          "transform": "@fortawesome/free-solid-svg-icons/${member}",
          "skipDefaultConversion": true
        },
        "@fortawesome/free-regular-svg-icons": {
          "transform": "@fortawesome/free-regular-svg-icons/${member}",
          "skipDefaultConversion": true
        },
        "@fortawesome/free-brands-svg-icons": {
          "transform": "@fortawesome/free-brands-svg-icons/${member}",
          "skipDefaultConversion": true
        }
      }
    ]
  ]
}

Remember that you need to install the plugin as well and make sure the conversion is really happening by looking to your final code inside the bundle.

Thanks @filipenevola, I must have another problem then because I do not have any undirect import in my code and still have this huge bundle.
Very weird, I have try removing dependencies that might cause problems but I still have the same size