import { config as loadEnv } from 'dotenv'; import { withSentryConfig } from '@sentry/nextjs'; import type { NextConfig } from 'next'; // The monorepo keeps one .env at the root; Next only looks in the app directory. loadEnv({ path: '../../.env' }); const config: NextConfig = { reactStrictMode: true, // The workspace packages ship TypeScript source, not build output. transpilePackages: ['@linkdr/api', '@linkdr/db', '@linkdr/shared', '@linkdr/storage'], images: { remotePatterns: [ // Seed data only — real pros upload to R2. The deck renders a plain , // so these matter only where next/image is used. { protocol: 'https', hostname: 'i.pravatar.cc' }, { protocol: 'https', hostname: 'picsum.photos' }, { protocol: 'https', hostname: '**.r2.dev' }, ], }, // postgres-js opens raw sockets; it must not be bundled into the server chunk. serverExternalPackages: ['postgres'], }; /** * Bugsink speaks the Sentry protocol, so the Sentry build plugin applies — but * only the parts that make sense for a self-hosted error tracker. * * Source maps are uploaded so a minified production stack is readable, and then * deleted from the build output so they are not served publicly. Everything * tracing-related stays off: Bugsink does not ingest it. */ export default withSentryConfig(config, { // Bugsink has no organisation/project slugs in the Sentry sense; the DSN // carries the project. These are only used by the upload step, which is // skipped entirely without an auth token. silent: true, disableLogger: true, sourcemaps: { deleteSourcemapsAfterUpload: true, }, // Do NOT route events through a Next rewrite: the tunnel exists to dodge ad // blockers against sentry.io, and this DSN is our own host already. tunnelRoute: undefined, // The SDK's automatic Vercel Cron instrumentation has nothing to talk to here. automaticVercelMonitors: false, });