|
| 1 | +// Next.js configuration |
1 | 2 | import { withSentryConfig } from '@sentry/nextjs'
|
2 | 3 |
|
3 |
| -// Next.js configuration |
4 | 4 | /**
|
5 | 5 | * @type {import('next').NextConfig}
|
6 | 6 | */
|
@@ -31,22 +31,39 @@ const nextConfig = {
|
31 | 31 | ],
|
32 | 32 | }
|
33 | 33 |
|
34 |
| -// Sentry configuration options |
35 |
| -const sentryWebpackPluginOptions = { |
| 34 | +const config = withSentryConfig(nextConfig, { |
| 35 | + // For all available options, see: |
| 36 | + // https://github.com/getsentry/sentry-webpack-plugin#options |
| 37 | + |
36 | 38 | org: 'chesstraining',
|
37 | 39 | project: 'chesstrainingapp',
|
38 |
| - // Suppresses source map uploading logs during build |
39 |
| - silent: true, |
| 40 | + |
| 41 | + // Only print logs for uploading source maps in CI |
| 42 | + silent: !process.env.CI, |
| 43 | + |
| 44 | + // For all available options, see: |
| 45 | + // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ |
| 46 | + |
40 | 47 | // Upload a larger set of source maps for prettier stack traces (increases build time)
|
41 | 48 | widenClientFileUpload: true,
|
| 49 | + |
| 50 | + // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. |
| 51 | + // This can increase your server load as well as your hosting bill. |
| 52 | + // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- |
| 53 | + // side errors will fail. |
| 54 | + tunnelRoute: '/monitoring', |
| 55 | + |
42 | 56 | // Hides source maps from generated client bundles
|
43 |
| - hideSourceMaps: false, |
| 57 | + hideSourceMaps: true, |
| 58 | + |
44 | 59 | // Automatically tree-shake Sentry logger statements to reduce bundle size
|
45 | 60 | disableLogger: true,
|
46 |
| - // Enables automatic instrumentation of Vercel Cron Monitors. |
| 61 | + |
| 62 | + // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) |
| 63 | + // See the following for more information: |
| 64 | + // https://docs.sentry.io/product/crons/ |
| 65 | + // https://vercel.com/docs/cron-jobs |
47 | 66 | automaticVercelMonitors: true,
|
48 |
| -} |
| 67 | +}) |
49 | 68 |
|
50 |
| -// Wrap your config with Sentry's configuration |
51 |
| -const config = withSentryConfig(nextConfig, sentryWebpackPluginOptions) |
52 | 69 | export default config
|
0 commit comments