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
jdsl
jdsl15mo ago
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.
jdsl
jdsl15mo ago
Try switching to default imports and see if that helps
dopeinc
dopeinc15mo ago
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.
jdsl
jdsl15mo ago
Nice! Thanks for the heads up on that
dollahane23033
dollahane2303315mo ago
Thanks, I'll look into this Default imports definitely seemed to solve this issue 👍🏼
jdsl
jdsl15mo ago
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.