parsaaghayi-front/next.config.mjs

58 lines
1.3 KiB
JavaScript

import withBundleAnalyzer from '@next/bundle-analyzer';
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
reactStrictMode: false,
turbopack: {},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'via.placeholder.com',
port: '',
pathname: '/**',
},
],
},
async rewrites() {
return [
{
source: '/api/website/:path*',
destination: `${process.env.NEXT_PUBLIC_BACK_URL}/api/website/:path*`,
},
{
source: '/api/blog/:path*',
destination: `${process.env.NEXT_PUBLIC_BACK_URL}/api/blog/:path*`,
},
];
},
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;