-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathnext.config.ts
More file actions
55 lines (46 loc) · 1.33 KB
/
Copy pathnext.config.ts
File metadata and controls
55 lines (46 loc) · 1.33 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 = {
// Next.js 16 uses Turbopack by default
reactStrictMode: true,
// Standalone output for Docker
output: 'standalone',
// Include SQL migration files in the serverless bundle
outputFileTracingIncludes: {
'/api/setup/migrate': ['./lib/migrations/**/*'],
},
// Environment variables exposed to client
env: {
NEXT_PUBLIC_APP_NAME: 'SmartZap',
},
// React Compiler for automatic memoization (moved from experimental in Next.js 16)
reactCompiler: true,
// Turbopack config
turbopack: {
// Set the workspace root to this directory
root: __dirname,
},
// Image optimization
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'picsum.photos',
},
],
},
// Headers for security and CORS
async headers() {
const allowedOrigin = process.env.FRONTEND_URL || 'https://smartzap.vercel.app'
return [
{
source: '/api/:path*',
headers: [
{ key: 'Access-Control-Allow-Origin', value: allowedOrigin },
{ key: 'Access-Control-Allow-Methods', value: 'GET, POST, PUT, DELETE, PATCH, OPTIONS' },
{ key: 'Access-Control-Allow-Headers', value: 'Content-Type, Authorization, X-API-Key' },
],
},
]
},
}
export default nextConfig