Files
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

39 lines
1.5 KiB
TypeScript

import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
output: process.env.VERCEL ? undefined : 'standalone',
transpilePackages: ['mathml2omml', 'pptxgenjs', '@openmaic/importer'],
// These agent packages do a runtime `import(specifier)` with a computed
// specifier (to lazily load node:fs/os/path without breaking browser/Vite
// builds). webpack can't statically analyze that and bundling it throws
// "Cannot find module as expression is too dynamic" at runtime on the server
// (the "Edit with AI" Pro-mode path), which broke the #619 keep-alive e2e.
// Mark them server-external so Next loads them natively and the dynamic
// import resolves as a real Node call.
serverExternalPackages: ['@earendil-works/pi-ai', '@earendil-works/pi-agent-core'],
experimental: {
proxyClientMaxBodySize: '200mb',
},
async headers() {
const extraAncestors = process.env.ALLOWED_FRAME_ANCESTORS?.trim();
const frameAncestors = extraAncestors ? `'self' ${extraAncestors}` : "'self'";
return [
{
source: '/(.*)',
headers: [
// X-Frame-Options only supports SAMEORIGIN (no allow-list),
// so we omit it when custom ancestors are configured.
...(!extraAncestors ? [{ key: 'X-Frame-Options', value: 'SAMEORIGIN' }] : []),
{
key: 'Content-Security-Policy',
value: `frame-ancestors ${frameAncestors}`,
},
],
},
];
},
};
export default nextConfig;