From 58285e428dcd9decb81dae634e92b96e9d4e30c9 Mon Sep 17 00:00:00 2001 From: bender Date: Tue, 10 Mar 2026 16:42:11 +0000 Subject: [PATCH] Add next.config.js --- next.config.js | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 next.config.js diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000..552d540 --- /dev/null +++ b/next.config.js @@ -0,0 +1,73 @@ +/** @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;