Multi-lockfile setups (e.g. running dev/build from inside a git worktree under .claude/worktrees/) caused Next.js to climb up to the parent repo's package-lock.json and resolve modules from the parent's node_modules, which doesn't have the new manual-rendering deps installed. Pinning turbopack.root to process.cwd() keeps each invocation scoped to the directory it was launched from. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import type { NextConfig } from "next"
|
|
import { withSentryConfig } from "@sentry/nextjs"
|
|
import pkg from "./package.json"
|
|
|
|
const nextConfig: NextConfig = {
|
|
reactStrictMode: true,
|
|
serverExternalPackages: ['sharp'],
|
|
// Pin Turbopack workspace root to the invocation directory so worktrees
|
|
// resolve their own node_modules instead of climbing into an outer lockfile.
|
|
turbopack: {
|
|
root: process.cwd(),
|
|
},
|
|
env: {
|
|
NEXT_PUBLIC_APP_VERSION: pkg.version,
|
|
NEXT_PUBLIC_BUILD_DATE: new Date().toISOString(),
|
|
},
|
|
}
|
|
|
|
// PBI/v1-readiness item 2: source-map-upload + tunnel pas actief als DSN +
|
|
// auth-token aanwezig zijn. Zonder env-vars draait `withSentryConfig` als
|
|
// no-op zodat lokale dev en CI zonder Sentry-creds blijft werken.
|
|
export default withSentryConfig(nextConfig, {
|
|
org: process.env.SENTRY_ORG,
|
|
project: process.env.SENTRY_PROJECT,
|
|
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
silent: !process.env.CI,
|
|
// Tunnel /monitoring → omzeilt ad-blockers die *.sentry.io blokkeren.
|
|
tunnelRoute: '/monitoring',
|
|
// Source-maps niet uploaden als auth-token ontbreekt.
|
|
sourcemaps: { disable: !process.env.SENTRY_AUTH_TOKEN },
|
|
disableLogger: true,
|
|
})
|