-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
37 lines (30 loc) · 945 Bytes
/
Copy pathnext.config.js
File metadata and controls
37 lines (30 loc) · 945 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
33
34
35
36
37
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
// Configure image optimization
images: {
domains: ['boulder.codes', 'buildersroom.boulder.codes'],
unoptimized: true, // Required for static export
},
// Security
poweredByHeader: false,
// Trailing slash for better compatibility
trailingSlash: true,
// Static export for Cloudflare Pages (production only)
output: process.env.NODE_ENV === 'production' ? 'export' : undefined,
// Disable source maps in production
productionBrowserSourceMaps: false,
// Exclude API pages from build
webpack: (config) => {
if (!process.env.INCLUDE_API_ROUTES) {
// Ignore API routes in client-side builds for deployment
config.module.rules.push({
test: /\/api\/.+\.(js|ts)x?$/,
loader: 'ignore-loader',
});
}
return config;
}
}
module.exports = nextConfig