-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnext.config.ts
More file actions
32 lines (30 loc) · 942 Bytes
/
next.config.ts
File metadata and controls
32 lines (30 loc) · 942 Bytes
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
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
reactCompiler: true,
// cacheComponents: true,
experimental: {
viewTransition: true,
inlineCss: true,
},
poweredByHeader: false,
images: {
formats: ['image/webp', 'image/avif'],
// Optimize image caching and reduce Fast Origin Transfer
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
minimumCacheTTL: 31536000, // 1 year in seconds
dangerouslyAllowSVG: true,
qualities: [75, 85],
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
},
// Optimize ISR performance
output: 'standalone',
// Reduce the number of prerendered pages
generateBuildId: async () => {
// Use a stable build ID to reduce cache invalidation
return 'stable-build-id'
},
// Enable compression
compress: true,
};
export default nextConfig;