-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
75 lines (68 loc) · 1.68 KB
/
Copy pathnext.config.ts
File metadata and controls
75 lines (68 loc) · 1.68 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
// Enable React Compiler for automatic optimizations
reactCompiler: true,
// Optimize images
images: {
formats: ["image/avif", "image/webp"],
minimumCacheTTL: 60 * 60 * 24 * 30, // 30 days
remotePatterns: [
{
protocol: "https",
hostname: "cdn.jsdelivr.net",
},
{
protocol: "https",
hostname: "img.clerk.com",
},
],
},
// Optimize production builds
experimental: {
// Optimize package imports to reduce bundle size
optimizePackageImports: [
"@fortawesome/fontawesome-svg-core",
"@fortawesome/free-solid-svg-icons",
"@fortawesome/free-brands-svg-icons",
"@fortawesome/free-regular-svg-icons",
"@heroicons/react",
"@headlessui/react",
],
},
// Reduce serverless function size
outputFileTracingIncludes: {},
// Headers for caching static assets and bundles
async headers() {
return [
{
source: "/:all*(svg|jpg|png|webp|avif|woff|woff2)",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
{
source: "/_next/static/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
{
source: "/:all*(js|css)",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, stale-while-revalidate=86400",
},
],
},
];
},
};
export default nextConfig;