SPB Git

spb/rareindex

Public
1.8 KB · 44 lines typescript
1import type { NextConfig } from 'next';2import path from 'node:path';34const nextConfig: NextConfig = {5  reactStrictMode: true,6  poweredByHeader: false,7  agentRules: false,8  // Workspace packages are consumed as TypeScript sources.9  transpilePackages: ['@rareindex/shared', '@rareindex/database', '@rareindex/taxonomy', '@rareindex/connectors', '@rareindex/ai'],10  serverExternalPackages: ['postgres', 'pino', 'cheerio', 'pg-boss', '@anthropic-ai/sdk', 'openai'],11  // Public API: /api/v1/* is proxied to the Fastify service (apps/api) so one public host serves web + API.12  async rewrites() {13    const api = process.env.RI_API_URL ?? `http://127.0.0.1:${process.env.API_PORT ?? 8211}`;14    return [{ source: '/api/v1/:path*', destination: `${api}/v1/:path*` }];15  },16  images: {17    remotePatterns: [{ protocol: 'https', hostname: '**' }],18    formats: ['image/avif', 'image/webp'],19  },20  experimental: {21    optimizePackageImports: ['lucide-react'],22    // Workspace packages use NodeNext-style `./file.js` imports that resolve to .ts sources.23    // Turbopack does not rewrite these outside the app root, so the app is built with webpack24    // (`next dev/build --webpack`) where extensionAlias handles the mapping.25    extensionAlias: { '.js': ['.ts', '.tsx', '.js'], '.mjs': ['.mts', '.mjs'] },26  },27  outputFileTracingRoot: path.resolve(__dirname, '../..'),28  async headers() {29    return [30      {31        source: '/(.*)',32        headers: [33          { key: 'X-Content-Type-Options', value: 'nosniff' },34          { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },35          { key: 'X-Frame-Options', value: 'SAMEORIGIN' },36          { key: 'Permissions-Policy', value: 'camera=(self), microphone=(), geolocation=()' },37        ],38      },39    ];40  },41};4243export default nextConfig;44
Files · 78cf9f7f3b34154bdac4f0af831574da262502f2
Menu

Theme