-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
55 lines (46 loc) · 1.47 KB
/
next.config.ts
File metadata and controls
55 lines (46 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Image optimization configuration
images: {
formats: ['image/avif', 'image/webp'], // Modern formats for better compression
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
minimumCacheTTL: 60 * 60 * 24 * 30, // Cache optimized images for 30 days
},
// Performance optimizations
compiler: {
removeConsole: process.env.NODE_ENV === 'production' ? {
exclude: ['error', 'warn'] // Remove console.logs in production
} : false,
},
// Experimental features for better performance
experimental: {
optimizePackageImports: ['framer-motion', 'lenis', '@paper-design/shaders-react'],
},
turbopack: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
});
// Optimize bundle size
if (process.env.NODE_ENV === 'production') {
// Better tree shaking
config.optimization = {
...config.optimization,
usedExports: true,
sideEffects: false,
};
}
return config;
},
};
export default nextConfig;