From fb32dea73cb7ff35ae3cdfe9bad99bc53de5e5b0 Mon Sep 17 00:00:00 2001 From: Richard R Date: Wed, 20 May 2026 15:53:26 -0600 Subject: [PATCH] build(config): adjust output and file tracing for Vercel and local compute modes Update Next.js configuration to conditionally set 'output' only when not on Vercel, and always define 'outputFileTracingExcludes' with dynamic includes based on compute mode. This ensures compatibility with Vercel deployments and improves local/server build behavior. --- next.config.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/next.config.ts b/next.config.ts index 73e514e..6df2903 100644 --- a/next.config.ts +++ b/next.config.ts @@ -21,6 +21,7 @@ const computeMode = computeModeRaw === 'none' || computeModeRaw === 'worker' || ? computeModeRaw : 'local'; const computeLocal = computeMode === 'local'; +const isVercel = process.env.VERCEL === '1'; const serverExternalPackages = [ '@napi-rs/canvas', 'ffmpeg-static', @@ -29,7 +30,7 @@ const serverExternalPackages = [ ]; const nextConfig: NextConfig = { - output: 'standalone', + ...(isVercel ? {} : { output: 'standalone' }), async headers() { return [ { @@ -66,16 +67,17 @@ const nextConfig: NextConfig = { './node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', ], }, - ...(!computeLocal - ? { - outputFileTracingExcludes: { - '/*': [ + outputFileTracingExcludes: { + '/*': [ + './docstore/**/*', + ...(!computeLocal + ? [ './node_modules/onnxruntime-node/**/*', './node_modules/@huggingface/tokenizers/**/*', - ], - }, - } - : {}), + ] + : []), + ], + }, webpack: (config, { isServer }) => { if (isServer) { // Use runtime require to avoid adding an explicit webpack TS dependency.