parsaaghayi-front/next.config.mjs
2024-09-30 12:15:43 +03:30

35 lines
870 B
JavaScript

import withBundleAnalyzer from '@next/bundle-analyzer';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
// سایر تنظیمات 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;