-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathnext.config.js
More file actions
30 lines (27 loc) · 951 Bytes
/
next.config.js
File metadata and controls
30 lines (27 loc) · 951 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
/** @type {import('next').NextConfig} */
const nextConfig = {
// Only use static export in production builds
...(process.env.NODE_ENV === 'production' && { output: 'export' }),
images: {
unoptimized: true, // Required for static export
},
reactStrictMode: true,
// Optional: Configure for subdirectory deployment
// Only use basePath for GitHub Pages (not Vercel or other platforms)
...(process.env.GITHUB_ACTIONS && {
basePath: '/eziwiki',
assetPrefix: '/eziwiki',
}),
trailingSlash: true, // Ensures proper routing for static hosting
// Disable source maps in production to prevent viewing original source
productionBrowserSourceMaps: false,
// Additional optimization for production
...(process.env.NODE_ENV === 'production' && {
compiler: {
removeConsole: {
exclude: ['error', 'warn'], // Remove console.log but keep error/warn
},
},
}),
};
module.exports = nextConfig;