import type { NextConfig } from 'next'; const config: NextConfig = { output: process.env.WF_LOCAL_ACCESS === 'true' ? undefined : 'standalone', poweredByHeader: false, agentRules: false, devIndicators: false, ...(process.env.WF_LOCAL_ACCESS === 'true' ? { allowedDevOrigins: (process.env.WF_LOCAL_ALLOWED_ORIGINS ?? '') .split(',') .filter(Boolean) .map(value => new URL(value.trim()).hostname), } : {}), experimental: { optimizePackageImports: ['lucide-react'], // Local development clusters run a development build (the image's WEB_BUILD=development): // development sign-in exists only there, since production builds inline NODE_ENV=production. ...(process.env.WF_WEB_DEVELOPMENT_BUILD === 'true' ? { allowDevelopmentBuild: true as const } : {}), }, async headers() { return [ { source: '/:path*', headers: [ { key: 'X-Content-Type-Options', value: 'nosniff' }, { key: 'Referrer-Policy', value: 'same-origin' }, { key: 'X-Frame-Options', value: 'SAMEORIGIN' }, ], }, ]; }, }; export default config;