NEXT 13 Compile Time
Hey guys, is this compile time normal for running MUI and Redux in a NEXT 13 React App? I only have a navbar going with 4 icons and already have 6s compile times.
6 Replies
I've had issues with MUI in the past doing that to a project. Are you using named imports? That could be the reason for the long compile times.
https://mui.com/material-ui/guides/minimizing-bundle-size/#development-environment
Minimizing bundle size - Material UI
Learn more about the tools you can leverage to reduce the bundle size.
Try switching to default imports and see if that helps
You can do that automatically inside next js config with modularizrd import without switching them manually : https://nextjs.org/blog/next-13-1#import-resolution-for-smaller-bundles
Also :
“@mui/icons-material”: { transform : “@mui/icons-material/{{member}}”
},
Next.js 13.1
Next.js 13.1 introduces improvements to the app directory, built-in module transpilation, stable edge runtime for API Routes, and many improvements to Turbopack support.
Nice! Thanks for the heads up on that
Thanks, I'll look into this
Default imports definitely seemed to solve this issue 👍🏼
Awesome! Glad to hear that sped dev compile times back up.
If you could right click the answer and select
Apps > Mark as Solution
that will help others find it.