Next.js Slow Page Load in Dev upto 2 mins

/** @type {import('next').NextConfig} */
const nextConfig = {
// reactStrictMode: true,
output: "export",
distDir: "dist",
swcMinify: true,
trailingSlash: false,
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
modularizeImports: {
"@mui/icons-material/?(((\\w*)?/?)*)": {
transform: "@mui/icons-material/{{ matches.[1] }}/{{member}}",
},
},
images: {
domains: ["tcommer.s3.eu-north-1.amazonaws.com"],
unoptimized: true,
},
}

module.exports = nextConfig`
/** @type {import('next').NextConfig} */
const nextConfig = {
// reactStrictMode: true,
output: "export",
distDir: "dist",
swcMinify: true,
trailingSlash: false,
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
modularizeImports: {
"@mui/icons-material/?(((\\w*)?/?)*)": {
transform: "@mui/icons-material/{{ matches.[1] }}/{{member}}",
},
},
images: {
domains: ["tcommer.s3.eu-north-1.amazonaws.com"],
unoptimized: true,
},
}

module.exports = nextConfig`
1 Reply
Luke
Luke3mo ago
I'm not sure that posting your Next.js config is the answer here, I mean it could be your AWS image server but it's unlikely. You are also doing some crazy regexing in your modularizeImports. Have you tried just doing a delete of your .next and node_modules folders from the root of your project and re-running? Helps me get through some odd behavior developing locally
Want results from more Discord servers?
Add your server