Webpack MUI5 Tree-Shaking

40 Views Asked by At

I would like to see a simple example of a react app with MUI5 and webpack where the tree-shaking works. (proof with webpack-bundle-analyzer) I would like to implement the same thing but somehow, I have not managed to achieve it. Is it possible? It can be that I have misunderstood something. Thank you in advance.

I have gone through this page: https://mui.com/material-ui/guides/minimizing-bundle-size/ but it did not help me.

with using imports like:

import createTheme, { Theme } from '@mui/material/styles/createTheme';

mui-bundle-size

Would it be possible achieve the same result with this import structure:

import { Theme, createTheme } from '@mui/material';

mui-bundle-size

0

There are 0 best solutions below