-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
85 lines (84 loc) · 2.61 KB
/
next.config.js
File metadata and controls
85 lines (84 loc) · 2.61 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
/** @type {import('next').NextConfig} */
const nextConfig = {
// Remove output: "export" to enable API routes
// output: "export",
staticPageGenerationTimeout: 180, // Increase timeout to 3 minutes
eslint: {
ignoreDuringBuilds: true,
dirs: ['pages', 'app', 'components', 'hooks', 'lib', 'data', 'types'],
},
images: {
unoptimized: true,
minimumCacheTTL: 60,
domains: [
'res.cloudinary.com',
'media.licdn.com',
'images.credly.com',
'v0.dev',
'bolt.new',
'cursor.com',
'codeium.com',
'claudemcp.com',
],
formats: ['image/webp'],
},
// Custom headers cannot be used with output: 'export'
// The resume can be placed in the /public folder and accessed directly
env: {
RESEND_API_KEY: process.env.RESEND_API_KEY,
},
// Add performance optimizations
poweredByHeader: false,
reactStrictMode: true,
compiler: {
removeConsole: process.env.NODE_ENV === 'production',
},
// Add security headers
async headers() {
return [
{
source: '/:path*',
headers: [
{ key: 'X-DNS-Prefetch-Control', value: 'on' },
{ key: 'X-XSS-Protection', value: '1; mode=block' },
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'origin-when-cross-origin' },
{
key: 'Content-Security-Policy',
value:
"default-src 'self'; img-src 'self' data: https:; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://*.vercel-scripts.com https://*.vercel-insights.com https://*.vercel-analytics.com https://*.cloudflareinsights.com; style-src 'self' 'unsafe-inline'; font-src 'self' data:; connect-src 'self' https://*.vercel-scripts.com https://*.vercel-insights.com https://*.vercel-analytics.com https://*.cloudflareinsights.com;",
},
],
},
];
},
// Webpack configuration
webpack: (config, { dev, isServer }) => {
// Optimize production builds
if (!dev && !isServer) {
config.optimization.splitChunks = {
chunks: 'all',
minSize: 20000,
maxSize: 244000,
minChunks: 1,
maxAsyncRequests: 30,
maxInitialRequests: 30,
cacheGroups: {
defaultVendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10,
reuseExistingChunk: true,
},
default: {
minChunks: 2,
priority: -20,
reuseExistingChunk: true,
},
},
};
}
return config;
},
};
export default nextConfig;