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'],10 serverExternalPackages: ['postgres', 'pino', 'cheerio'],11 images: {12 remotePatterns: [{ protocol: 'https', hostname: '**' }],13 formats: ['image/avif', 'image/webp'],14 },15 experimental: {16 optimizePackageImports: ['lucide-react'],17 // Workspace packages use NodeNext-style `./file.js` imports that resolve to .ts sources.18 // Turbopack does not rewrite these outside the app root, so the app is built with webpack19 // (`next dev/build --webpack`) where extensionAlias handles the mapping.20 extensionAlias: { '.js': ['.ts', '.tsx', '.js'], '.mjs': ['.mts', '.mjs'] },21 },22 outputFileTracingRoot: path.resolve(__dirname, '../..'),23 async headers() {24 return [25 {26 source: '/(.*)',27 headers: [28 { key: 'X-Content-Type-Options', value: 'nosniff' },29 { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },30 { key: 'X-Frame-Options', value: 'SAMEORIGIN' },31 { key: 'Permissions-Policy', value: 'camera=(self), microphone=(), geolocation=()' },32 ],33 },34 ];35 },36};3738export default nextConfig;39