74 lines
1.6 KiB
JavaScript
74 lines
1.6 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
// Enable SWC minification for smaller bundle
|
|
swcMinify: true,
|
|
|
|
// Enable experimental optimizations
|
|
experimental: {
|
|
optimizePackageImports: [
|
|
'lucide-react',
|
|
'@/components',
|
|
'@/providers'
|
|
]
|
|
},
|
|
|
|
// Image optimization
|
|
images: {
|
|
formats: ['image/webp', 'image/avif'],
|
|
remotePatterns: [
|
|
{
|
|
protocol: 'http',
|
|
hostname: 'img.b2bpic.net'
|
|
},
|
|
{
|
|
protocol: 'https',
|
|
hostname: '**'
|
|
}
|
|
]
|
|
},
|
|
|
|
// Enable compression
|
|
compress: true,
|
|
|
|
// Optimize production builds
|
|
productionBrowserSourceMaps: false,
|
|
|
|
// Generate static analysis
|
|
webpack: (config, { isServer }) => {
|
|
if (!isServer) {
|
|
config.optimization = {
|
|
...config.optimization,
|
|
runtimeChunk: 'single',
|
|
splitChunks: {
|
|
chunks: 'all',
|
|
cacheGroups: {
|
|
default: false,
|
|
vendors: false,
|
|
lucide: {
|
|
test: /[\\/]node_modules[\\/](lucide-react)[\\/]/,
|
|
name: 'lucide',
|
|
priority: 10,
|
|
reuseExistingChunk: true
|
|
},
|
|
react: {
|
|
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
|
|
name: 'react',
|
|
priority: 20,
|
|
reuseExistingChunk: true
|
|
},
|
|
common: {
|
|
minChunks: 2,
|
|
priority: 5,
|
|
reuseExistingChunk: true,
|
|
name: 'common'
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
return config;
|
|
}
|
|
};
|
|
|
|
module.exports = nextConfig;
|