parsaaghayi-front/next.config.mjs
2024-10-13 18:33:43 +03:30

45 lines
1.0 KiB
JavaScript

import withBundleAnalyzer from '@next/bundle-analyzer';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'via.placeholder.com',
port: '',
pathname: '/**',
},
],
},
// سایر تنظیمات Next.js شما
webpack(config, { isServer }) {
if (!isServer) {
config.optimization.splitChunks = {
chunks: 'all',
minSize: 30000,
maxAsyncRequests: 30,
maxInitialRequests: 30,
automaticNameDelimiter: '-',
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
},
},
};
}
return config;
},
};
const withBundle = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
// می‌توانید تنظیمات اضافی پلاگین را اینجا اضافه کنید
})(nextConfig);
export default withBundle;