- Using MUI in DEV results in a custom design for my application
- In Prod, the custom design is missing when using MUI
Do I need to implement something differently? Is there an extra configuration required?
An example of something not working:
<Typography className={styles.customStyle} component="h1">
{t("Translation")}
</Typography>
The className={styles.customStyle}
is being ignored completely in Prod, although it works fine in DEV.
Details of my current configuration
Node version: v19.0.0
Package.json details:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@mui/icons-material": "^5.11.0",
// Additional dependencies listed here
}
}
- Additional configurations in next.config.js:
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
appDir: true,
},
}
module.exports = nextConfig