|
| 1 | +import { withSentryConfig } from "@sentry/nextjs"; |
1 | 2 | import { withPayload } from "@payloadcms/next/withPayload"; |
2 | 3 | import path from "path"; |
3 | 4 |
|
@@ -43,4 +44,38 @@ const nextConfig = { |
43 | 44 | transpilePackages: ["@commons-ui/core", "@commons-ui/next"], |
44 | 45 | }; |
45 | 46 |
|
46 | | -export default withPayload(nextConfig); |
| 47 | +export default withPayload( |
| 48 | + withSentryConfig(nextConfig, { |
| 49 | + // For all available options, see: |
| 50 | + // https://www.npmjs.com/package/@sentry/webpack-plugin#options |
| 51 | + |
| 52 | + authToken: process.env.SENTRY_AUTH_TOKEN, |
| 53 | + |
| 54 | + org: process.env.SENTRY_ORG, |
| 55 | + project: process.env.SENTRY_PROJECT, |
| 56 | + |
| 57 | + // Only print logs for uploading source maps in CI |
| 58 | + silent: !process.env.CI, |
| 59 | + |
| 60 | + // For all available options, see: |
| 61 | + // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ |
| 62 | + |
| 63 | + // Upload a larger set of source maps for prettier stack traces (increases build time) |
| 64 | + widenClientFileUpload: true, |
| 65 | + |
| 66 | + // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. |
| 67 | + // This can increase your server load as well as your hosting bill. |
| 68 | + // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- |
| 69 | + // side errors will fail. |
| 70 | + tunnelRoute: "/monitoring", |
| 71 | + |
| 72 | + // Automatically tree-shake Sentry logger statements to reduce bundle size |
| 73 | + disableLogger: true, |
| 74 | + |
| 75 | + // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) |
| 76 | + // See the following for more information: |
| 77 | + // https://docs.sentry.io/product/crons/ |
| 78 | + // https://vercel.com/docs/cron-jobs |
| 79 | + automaticVercelMonitors: true, |
| 80 | + }), |
| 81 | +); |
0 commit comments