feat(ai-search): optimize dev server, add qdrant boot sync, fix orb overflow
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Successful in 1m0s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled

This commit is contained in:
2026-03-06 22:35:48 +01:00
parent 81ce3a4588
commit 4dcdb717f0
16 changed files with 1981 additions and 380 deletions

View File

@@ -7,18 +7,28 @@ import { withPayload } from '@payloadcms/next/withPayload';
const isProd = process.env.NODE_ENV === 'production';
/** @type {import('next').NextConfig} */
const nextConfig = {
serverExternalPackages: ['@mintel/payload-ai'],
transpilePackages: ['react-image-crop', '@react-three/fiber'],
onDemandEntries: {
// Make sure entries are not disposed too quickly
maxInactiveAge: 60 * 1000,
// Keep compiled pages/routes in memory for 5 minutes (reduced from 25m to prevent OOM)
maxInactiveAge: 5 * 60 * 1000,
// Keep up to 2 pages in the dev buffer (reduced from 10 to prevent OOM)
pagesBufferLength: 2,
},
experimental: {
optimizePackageImports: ['lucide-react', 'framer-motion', '@/components/ui'],
cpus: 3,
optimizePackageImports: [
'lucide-react',
'framer-motion',
'@/components/ui',
'@sentry/nextjs',
'@payloadcms/richtext-lexical',
'react-hook-form',
'zod',
'date-fns',
],
workerThreads: false,
memoryBasedWorkersCount: true,
},
reactStrictMode: false,
swcMinify: true,
productionBrowserSourceMaps: false,
logging: {
fetches: {
@@ -26,6 +36,21 @@ const nextConfig = {
},
},
...(isProd ? { output: 'standalone' } : {}),
// Prevent webpack from restarting when .env files are touched via Docker volume mount
webpack: (config, { dev }) => {
if (dev) {
config.watchOptions = {
...config.watchOptions,
ignored: /node_modules|\.env/,
// Reduce poll frequency to lower CPU churn from VirtioFS
poll: 1000,
aggregateTimeout: 300,
};
// Reduce source map quality in dev for faster rebuilds
config.devtool = 'eval';
}
return config;
},
async headers() {
const isProd = process.env.NODE_ENV === 'production';
const umamiDomain = new URL(process.env.UMAMI_API_ENDPOINT || 'https://analytics.infra.mintel.me').origin;
@@ -48,7 +73,7 @@ const nextConfig = {
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com;
img-src 'self' data: blob: ${extraImgDomains};
connect-src 'self' ${umamiDomain} ${glitchtipDomain};
connect-src 'self' ${umamiDomain} ${glitchtipDomain} https://raw.githack.com https://raw.githubusercontent.com;
frame-src 'self';
object-src 'none';
base-uri 'self';
@@ -394,6 +419,7 @@ const nextConfig = {
];
},
images: {
qualities: [25, 50, 75, 100],
formats: ['image/webp'],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
remotePatterns: [