2025-08-22 17:02:49 +09:00
|
|
|
/* eslint-env node */
|
2025-08-20 18:02:50 +09:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
|
const nextConfig = {
|
|
|
|
|
// Enable standalone output for production deployment
|
2025-08-22 17:02:49 +09:00
|
|
|
output: "standalone",
|
|
|
|
|
|
2025-08-20 18:02:50 +09:00
|
|
|
// Turbopack configuration (Next.js 15.5+)
|
|
|
|
|
turbopack: {
|
|
|
|
|
// Enable Turbopack optimizations
|
|
|
|
|
resolveAlias: {
|
|
|
|
|
// Path aliases for cleaner imports
|
2025-08-22 17:02:49 +09:00
|
|
|
"@": "./src",
|
2025-08-20 18:02:50 +09:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Environment variables validation
|
|
|
|
|
env: {
|
|
|
|
|
NEXT_PUBLIC_API_BASE: process.env.NEXT_PUBLIC_API_BASE,
|
|
|
|
|
NEXT_PUBLIC_APP_NAME: process.env.NEXT_PUBLIC_APP_NAME,
|
|
|
|
|
NEXT_PUBLIC_APP_VERSION: process.env.NEXT_PUBLIC_APP_VERSION,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Image optimization
|
|
|
|
|
images: {
|
|
|
|
|
remotePatterns: [
|
|
|
|
|
{
|
2025-08-22 17:02:49 +09:00
|
|
|
protocol: "https",
|
|
|
|
|
hostname: "**",
|
2025-08-20 18:02:50 +09:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Security headers
|
|
|
|
|
async headers() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
// Apply security headers to all routes
|
2025-08-22 17:02:49 +09:00
|
|
|
source: "/(.*)",
|
2025-08-20 18:02:50 +09:00
|
|
|
headers: [
|
|
|
|
|
{
|
2025-08-22 17:02:49 +09:00
|
|
|
key: "X-Frame-Options",
|
|
|
|
|
value: "DENY",
|
2025-08-20 18:02:50 +09:00
|
|
|
},
|
|
|
|
|
{
|
2025-08-22 17:02:49 +09:00
|
|
|
key: "X-Content-Type-Options",
|
|
|
|
|
value: "nosniff",
|
2025-08-20 18:02:50 +09:00
|
|
|
},
|
|
|
|
|
{
|
2025-08-22 17:02:49 +09:00
|
|
|
key: "Referrer-Policy",
|
|
|
|
|
value: "strict-origin-when-cross-origin",
|
2025-08-20 18:02:50 +09:00
|
|
|
},
|
|
|
|
|
{
|
2025-08-22 17:02:49 +09:00
|
|
|
key: "X-XSS-Protection",
|
|
|
|
|
value: "1; mode=block",
|
2025-08-20 18:02:50 +09:00
|
|
|
},
|
|
|
|
|
// Content Security Policy - development-friendly
|
|
|
|
|
{
|
2025-08-22 17:02:49 +09:00
|
|
|
key: "Content-Security-Policy",
|
|
|
|
|
value:
|
|
|
|
|
process.env.NODE_ENV === "development"
|
|
|
|
|
? "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https: http://localhost:* ws://localhost:*; frame-ancestors 'none';"
|
|
|
|
|
: "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https:; frame-ancestors 'none';",
|
|
|
|
|
},
|
2025-08-20 18:02:50 +09:00
|
|
|
],
|
|
|
|
|
},
|
2025-08-22 17:02:49 +09:00
|
|
|
];
|
2025-08-20 18:02:50 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Production optimizations
|
|
|
|
|
compiler: {
|
|
|
|
|
// Remove console.logs in production
|
2025-08-22 17:02:49 +09:00
|
|
|
removeConsole: process.env.NODE_ENV === "production",
|
2025-08-20 18:02:50 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Note: Webpack configuration removed - using Turbopack exclusively
|
|
|
|
|
// Turbopack handles bundling automatically with better performance
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-22 17:02:49 +09:00
|
|
|
export default nextConfig;
|