Skip to content

Instantly share code, notes, and snippets.

@breakerh
Last active August 11, 2023 14:31
Show Gist options
  • Save breakerh/613062a8e3d50a994db26d984e1089d4 to your computer and use it in GitHub Desktop.
Save breakerh/613062a8e3d50a994db26d984e1089d4 to your computer and use it in GitHub Desktop.
nextjs config file to prevent the client side from loading slow when using mui
/** @type {import('next').NextConfig} */
const nextConfig = {
/*experimental: {
appDir: true,
},*/
modularizeImports: {
'@mui/material': {
transform: '@mui/material/{{member}}'
},
'@mui/lab': {
transform: '@mui/lab/{{member}}'
},
'@mui/icons-material/?(((\w)?/?)*)': {
transform: '@mui/icons-material/{{ matches.[1] }}/{{member}}'
}
}
}
module.exports = nextConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment