54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const nextConfig: NextConfig = {
|
|
// Performance optimizations
|
|
compress: true, // Enable gzip compression
|
|
|
|
// Optimize images (if any are added later)
|
|
images: {
|
|
formats: ['image/avif', 'image/webp'],
|
|
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
|
|
},
|
|
|
|
// Experimental features for better performance
|
|
experimental: {
|
|
optimizePackageImports: ['lucide-react', '@react-three/fiber', '@react-three/drei'],
|
|
},
|
|
|
|
// Webpack optimizations
|
|
webpack: (config, { isServer }) => {
|
|
// Optimize bundle size
|
|
if (!isServer) {
|
|
config.optimization = {
|
|
...config.optimization,
|
|
moduleIds: 'deterministic',
|
|
splitChunks: {
|
|
chunks: 'all',
|
|
cacheGroups: {
|
|
default: false,
|
|
vendors: false,
|
|
// Vendor chunk for heavy libraries
|
|
vendor: {
|
|
name: 'vendor',
|
|
chunks: 'all',
|
|
test: /node_modules/,
|
|
priority: 20,
|
|
},
|
|
// Separate chunk for three.js (heavy)
|
|
three: {
|
|
name: 'three',
|
|
chunks: 'all',
|
|
test: /[\\/]node_modules[\\/](three|@react-three)[\\/]/,
|
|
priority: 30,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}
|
|
return config;
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|