-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
131 lines (127 loc) · 4.34 KB
/
next.config.js
File metadata and controls
131 lines (127 loc) · 4.34 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
const dotenv = require('dotenv')
dotenv.config()
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: 'standalone',
// The compiler reduces the amount of manual memoization
// developers have to do through APIs such as useMemo and useCallback
// - making code simpler, easier to maintain, and less error prone.
// -----Removed but will be needed to upgrade to React 19-----
reactCompiler: true,
// Enable Cache Components for Partial Pre-rendering (PPR)
// This allows instant static shell loads while dynamic content streams in
cacheComponents: true,
cacheLife: {
// Media library lists - 1 minute cache for fresh content while reducing DB load
mediaLists: {
stale: 60, // 1 minute client cache
revalidate: 60, // 1 minute server revalidation
expire: 300, // 5 minutes max before forced refresh
},
// Navigation and UI components - rarely change
navigation: {
stale: 300, // 5 minutes client cache
revalidate: 3600, // 1 hour server revalidation
expire: 86400, // 1 day expiration
},
// User-specific content - moderate frequency
userContent: {
stale: 60, // 1 minute client cache
revalidate: 900, // 15 minutes server revalidation
expire: 3600, // 1 hour expiration
},
// External API data (TMDB, etc.) - infrequent updates, expensive to fetch
externalData: {
stale: 300, // 5 minutes client cache
revalidate: 3600, // 1 hour server revalidation (TMDB data rarely changes)
expire: 86400, // 1 day expiration for better performance
},
// System status - frequently updated
systemStatus: {
stale: 30, // 30 seconds client cache
revalidate: 60, // 1 minute server revalidation
expire: 300, // 5 minutes expiration
},
},
//esmExternals: false,
// ESLint Configuration
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
allowedDevOrigins: ['localhost', 'cinema-local.adamdrumm.com'],
images: {
formats: ['image/avif', 'image/webp'],
minimumCacheTTL: 259200,
remotePatterns: [{
protocol: 'https',
hostname: '**', // Allows all hosts
port: '',
pathname: '/**',
}],
qualities: [25, 50, 75, 90, 100],
// remotePatterns: process.env.REMOTE_PATTERNS
// ? process.env.REMOTE_PATTERNS.split(',').map((pattern) => {
// const [protocol, hostname] = pattern.trim().split('://')
// return { protocol, hostname }
// })
// : [
// {
// protocol: 'https',
// hostname: 'image.tmdb.org',
// },
// {
// protocol: 'https',
// hostname: 'm.media-amazon.com',
// },
// {
// protocol: 'https',
// hostname: 'iconape.com',
// },
// {
// protocol: 'https',
// hostname: 'www.freeiconspng.com',
// },
// ],
},
// CRITICAL: Include OpenTelemetry packages in standalone output
// Without this, the OTEL packages won't be available at runtime
outputFileTracingIncludes: {
'*': [
// Core OpenTelemetry packages
'./node_modules/@opentelemetry/**/*',
'./node_modules/@vercel/**/*',
// Instrumentation file (should be src/ since you're using src folder)
'./src/instrumentation.ts',
],
},
// Packages that should not be bundled (they need to be required at runtime)
serverExternalPackages: [
'@opentelemetry/sdk-node',
'@opentelemetry/auto-instrumentations-node',
'@opentelemetry/exporter-trace-otlp-http',
'@opentelemetry/exporter-metrics-otlp-http',
'@opentelemetry/exporter-logs-otlp-http',
'@opentelemetry/resources',
'@opentelemetry/semantic-conventions',
'@opentelemetry/sdk-trace-base',
'@opentelemetry/sdk-metrics',
'@opentelemetry/sdk-logs',
'@opentelemetry/instrumentation-http',
'@opentelemetry/instrumentation-fetch',
'@opentelemetry/instrumentation-pino',
'@opentelemetry/api',
'@vercel/otel',
'pino',
],
// Additional Next.js configurations can be added here
/* webpack(config) {
Object.defineProperty(config, 'devtool', {
get() {
return 'source-map'
},
set() {},
})
return config
}, */
//productionBrowserSourceMaps: true,
}
module.exports = nextConfig