2025-10-31 22:23:45 +01:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
|
const nextConfig = {
|
|
|
|
|
// Enable React strict mode for better development experience
|
|
|
|
|
reactStrictMode: true,
|
|
|
|
|
|
|
|
|
|
// Output standalone for Docker deployment
|
|
|
|
|
output: 'standalone',
|
|
|
|
|
|
|
|
|
|
// Compiler options
|
|
|
|
|
compiler: {
|
|
|
|
|
// Remove console logs in production
|
|
|
|
|
removeConsole: process.env.NODE_ENV === 'production' ? {
|
|
|
|
|
exclude: ['error', 'warn'],
|
|
|
|
|
} : false,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Image optimization configuration
|
|
|
|
|
images: {
|
|
|
|
|
domains: ['s3.puffinoffset.com'],
|
|
|
|
|
formats: ['image/avif', 'image/webp'],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Headers for security and caching
|
|
|
|
|
async headers() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
source: '/:path*',
|
|
|
|
|
headers: [
|
|
|
|
|
{
|
|
|
|
|
key: 'X-DNS-Prefetch-Control',
|
|
|
|
|
value: 'on'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'X-Frame-Options',
|
|
|
|
|
value: 'SAMEORIGIN'
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-11-04 15:32:50 +01:00
|
|
|
// Service Worker - no cache to ensure updates are detected immediately
|
|
|
|
|
{
|
|
|
|
|
source: '/sw.js',
|
|
|
|
|
headers: [
|
|
|
|
|
{
|
|
|
|
|
key: 'Cache-Control',
|
|
|
|
|
value: 'no-cache, no-store, must-revalidate',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'Service-Worker-Allowed',
|
|
|
|
|
value: '/',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-10-31 22:23:45 +01:00
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Turbopack configuration (Next.js 16 default)
|
|
|
|
|
turbopack: {},
|
|
|
|
|
|
|
|
|
|
// Webpack configuration for any custom needs
|
|
|
|
|
webpack: (config, { isServer }) => {
|
|
|
|
|
// Fixes npm packages that depend on node modules
|
|
|
|
|
if (!isServer) {
|
|
|
|
|
config.resolve.fallback = {
|
|
|
|
|
...config.resolve.fallback,
|
|
|
|
|
fs: false,
|
|
|
|
|
net: false,
|
|
|
|
|
tls: false,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return config;
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default nextConfig;
|