2025-11-28 12:54:33 -08:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
|
const nextConfig = {
|
|
|
|
|
reactStrictMode: true,
|
|
|
|
|
swcMinify: true,
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
// Configure cache busting with build ID
|
|
|
|
|
generateBuildId: async () => {
|
|
|
|
|
return process.env.BUILD_ID || `build-${Date.now()}`
|
|
|
|
|
},
|
2025-11-28 12:54:33 -08:00
|
|
|
images: {
|
|
|
|
|
domains: [],
|
|
|
|
|
formats: ['image/avif', 'image/webp'],
|
|
|
|
|
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
|
|
|
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
|
|
|
|
|
},
|
|
|
|
|
experimental: {
|
|
|
|
|
optimizePackageImports: ['lucide-react', '@react-three/fiber', '@react-three/drei'],
|
|
|
|
|
},
|
|
|
|
|
webpack: (config, { isServer }) => {
|
|
|
|
|
if (!isServer) {
|
|
|
|
|
// Optimize bundle splitting
|
|
|
|
|
config.optimization.splitChunks = {
|
|
|
|
|
chunks: 'all',
|
|
|
|
|
cacheGroups: {
|
|
|
|
|
default: false,
|
|
|
|
|
vendors: false,
|
|
|
|
|
framework: {
|
|
|
|
|
name: 'framework',
|
|
|
|
|
chunks: 'all',
|
|
|
|
|
test: /(?<!node_modules.*)[\\/]node_modules[\\/](react|react-dom|scheduler|prop-types|use-subscription)[\\/]/,
|
|
|
|
|
priority: 40,
|
|
|
|
|
enforce: true,
|
|
|
|
|
},
|
|
|
|
|
lib: {
|
|
|
|
|
test: /[\\/]node_modules[\\/]/,
|
|
|
|
|
name(module) {
|
|
|
|
|
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)?.[1]
|
|
|
|
|
return `npm.${packageName?.replace('@', '')}`
|
|
|
|
|
},
|
|
|
|
|
priority: 30,
|
|
|
|
|
minChunks: 1,
|
|
|
|
|
reuseExistingChunk: true,
|
|
|
|
|
},
|
|
|
|
|
commons: {
|
|
|
|
|
name: 'commons',
|
|
|
|
|
minChunks: 2,
|
|
|
|
|
priority: 20,
|
|
|
|
|
},
|
|
|
|
|
shared: {
|
|
|
|
|
name() {
|
|
|
|
|
return 'shared'
|
|
|
|
|
},
|
|
|
|
|
minChunks: 2,
|
|
|
|
|
priority: 10,
|
|
|
|
|
reuseExistingChunk: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return config
|
|
|
|
|
},
|
|
|
|
|
async headers() {
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
const isDev = process.env.NODE_ENV === 'development'
|
|
|
|
|
|
2025-11-28 12:54:33 -08:00
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
source: '/:path*',
|
|
|
|
|
headers: [
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
{
|
|
|
|
|
key: 'Content-Type',
|
|
|
|
|
value: 'text/html; charset=utf-8',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'X-Content-Type-Options',
|
|
|
|
|
value: 'nosniff',
|
|
|
|
|
},
|
2025-11-28 12:54:33 -08:00
|
|
|
{
|
|
|
|
|
key: 'X-DNS-Prefetch-Control',
|
|
|
|
|
value: 'on',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'Strict-Transport-Security',
|
|
|
|
|
value: 'max-age=63072000; includeSubDomains; preload',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'X-Frame-Options',
|
|
|
|
|
value: 'DENY',
|
|
|
|
|
},
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
// X-XSS-Protection removed - deprecated and not needed with CSP
|
2025-11-28 12:54:33 -08:00
|
|
|
{
|
|
|
|
|
key: 'Referrer-Policy',
|
|
|
|
|
value: 'strict-origin-when-cross-origin',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'Permissions-Policy',
|
|
|
|
|
value: 'camera=(), microphone=(), geolocation=()',
|
|
|
|
|
},
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
// CSP is required for security
|
|
|
|
|
// In development, Next.js requires 'unsafe-eval' for hot reloading
|
|
|
|
|
// In production, we use stricter CSP without eval
|
2025-11-28 12:54:33 -08:00
|
|
|
{
|
|
|
|
|
key: 'Content-Security-Policy',
|
|
|
|
|
value: [
|
|
|
|
|
"default-src 'self'",
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
isDev
|
|
|
|
|
? "script-src 'self' 'unsafe-eval' 'unsafe-inline'"
|
|
|
|
|
: "script-src 'self' 'unsafe-inline'",
|
2025-11-28 12:54:33 -08:00
|
|
|
"style-src 'self' 'unsafe-inline'",
|
|
|
|
|
"img-src 'self' data: https:",
|
|
|
|
|
"font-src 'self' data:",
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
"connect-src 'self' https: ws: wss:",
|
2025-11-28 12:54:33 -08:00
|
|
|
].join('; '),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
// Content-Type headers for static assets (Next.js handles these automatically, but we ensure charset)
|
|
|
|
|
{
|
|
|
|
|
source: '/_next/static/:path*',
|
|
|
|
|
headers: [
|
|
|
|
|
{
|
|
|
|
|
key: 'Cache-Control',
|
|
|
|
|
value: 'public, max-age=31536000, immutable',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
source: '/_next/static/css/:path*.css',
|
|
|
|
|
headers: [
|
|
|
|
|
{
|
|
|
|
|
key: 'Content-Type',
|
|
|
|
|
value: 'text/css; charset=utf-8',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
source: '/_next/static/chunks/:path*.js',
|
|
|
|
|
headers: [
|
|
|
|
|
{
|
|
|
|
|
key: 'Content-Type',
|
|
|
|
|
value: 'text/javascript; charset=utf-8',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-11-28 12:54:33 -08:00
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = nextConfig
|
|
|
|
|
|