| |
| import { withSentryConfig } from '@sentry/nextjs'; |
|
|
| |
| const nextConfig = { |
| experimental: { |
| proxyTimeout: 90_000, |
| }, |
| |
| async headers() { |
| return [ |
| { |
| source: '/:path*', |
| headers: [ |
| { |
| key: 'Document-Policy', |
| value: 'js-profiling', |
| }, |
| ], |
| }, |
| ]; |
| }, |
| reactStrictMode: false, |
| transpilePackages: ['crypto-hash'], |
| |
| productionBrowserSourceMaps: !!process.env.SENTRY_AUTH_TOKEN, |
|
|
| |
| webpack: (config, { buildId, dev, isServer, defaultLoaders }) => { |
| |
| if (!dev && process.env.SENTRY_AUTH_TOKEN) { |
| config.devtool = isServer ? 'source-map' : 'hidden-source-map'; |
| } |
|
|
| return config; |
| }, |
| async redirects() { |
| return [ |
| { |
| source: '/api/uploads/:path*', |
| destination: |
| process.env.STORAGE_PROVIDER === 'local' ? '/uploads/:path*' : '/404', |
| permanent: true, |
| }, |
| ]; |
| }, |
| async rewrites() { |
| return [ |
| { |
| source: '/uploads/:path*', |
| destination: |
| process.env.STORAGE_PROVIDER === 'local' |
| ? '/api/uploads/:path*' |
| : '/404', |
| }, |
| ]; |
| }, |
| }; |
|
|
| export default withSentryConfig(nextConfig, { |
| org: process.env.SENTRY_ORG, |
| project: process.env.SENTRY_PROJECT, |
| authToken: process.env.SENTRY_AUTH_TOKEN, |
|
|
| |
| sourcemaps: { |
| disable: !process.env.SENTRY_AUTH_TOKEN, |
| |
| assets: [ |
| '.next/static/**/*.js', |
| '.next/static/**/*.js.map', |
| '.next/server/**/*.js', |
| '.next/server/**/*.js.map', |
| ], |
| ignore: [ |
| '**/node_modules/**', |
| '**/*hot-update*', |
| '**/_buildManifest.js', |
| '**/_ssgManifest.js', |
| '**/*.test.js', |
| '**/*.spec.js', |
| ], |
| deleteSourcemapsAfterUpload: true, |
| }, |
|
|
| |
| release: { |
| create: !!process.env.SENTRY_AUTH_TOKEN, |
| finalize: !!process.env.SENTRY_AUTH_TOKEN, |
| |
| name: |
| process.env.VERCEL_GIT_COMMIT_SHA || process.env.GITHUB_SHA || undefined, |
| }, |
|
|
| |
| widenClientFileUpload: true, |
|
|
| |
| telemetry: false, |
| silent: true, |
| debug: false, |
|
|
| |
| errorHandler: (error) => { |
| console.warn('Sentry build error occurred:', error.message); |
| console.warn( |
| 'This might be due to missing Sentry environment variables or network issues' |
| ); |
| |
| return; |
| }, |
| }); |
|
|