|
| 1 | +import { withSentryConfig } from "@sentry/nextjs"; |
1 | 2 | /** @type {import('next').NextConfig} */
|
2 | 3 | import analyzer from "@next/bundle-analyzer";
|
3 | 4 | import nextra from "nextra";
|
4 |
| -import path from "path"; |
5 |
| -import { fileURLToPath } from "url"; |
| 5 | +// import path from "path"; |
| 6 | +// import { fileURLToPath } from "url"; |
6 | 7 |
|
7 |
| -const __filename = fileURLToPath(import.meta.url); |
8 |
| -const __dirname = path.dirname(__filename); |
| 8 | +// const __filename = fileURLToPath(import.meta.url); |
| 9 | +// const __dirname = path.dirname(__filename); |
9 | 10 |
|
10 | 11 | const withNextra = nextra({
|
11 | 12 | theme: "nextra-theme-docs",
|
@@ -132,7 +133,7 @@ const nextConfig = withAnalyzer(
|
132 | 133 | experimental: {
|
133 | 134 | externalDir: true,
|
134 | 135 | },
|
135 |
| - webpack: (config, { isServer }) => { |
| 136 | + webpack: (config) => { |
136 | 137 | config.externals.push({
|
137 | 138 | // "@blocknote/core": "bncore",
|
138 | 139 | // "@blocknote/react": "bnreact",
|
@@ -183,4 +184,40 @@ const nextConfig = withAnalyzer(
|
183 | 184 | }),
|
184 | 185 | );
|
185 | 186 |
|
186 |
| -export default nextConfig; |
| 187 | +export default withSentryConfig(nextConfig, { |
| 188 | + // For all available options, see: |
| 189 | + // https://www.npmjs.com/package/@sentry/webpack-plugin#options |
| 190 | + |
| 191 | + org: "blocknote-js", |
| 192 | + project: "website", |
| 193 | + |
| 194 | + // Only print logs for uploading source maps in CI |
| 195 | + silent: !process.env.CI, |
| 196 | + |
| 197 | + // For all available options, see: |
| 198 | + // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ |
| 199 | + |
| 200 | + // Upload a larger set of source maps for prettier stack traces (increases build time) |
| 201 | + widenClientFileUpload: true, |
| 202 | + |
| 203 | + // Automatically annotate React components to show their full name in breadcrumbs and session replay |
| 204 | + reactComponentAnnotation: { |
| 205 | + enabled: true, |
| 206 | + }, |
| 207 | + |
| 208 | + // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. |
| 209 | + // This can increase your server load as well as your hosting bill. |
| 210 | + // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- |
| 211 | + // side errors will fail. |
| 212 | + tunnelRoute: "/monitoring", |
| 213 | + |
| 214 | + // Automatically tree-shake Sentry logger statements to reduce bundle size |
| 215 | + disableLogger: true, |
| 216 | + |
| 217 | + // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) |
| 218 | + // See the following for more information: |
| 219 | + // https://docs.sentry.io/product/crons/ |
| 220 | + // https://vercel.com/docs/cron-jobs |
| 221 | + automaticVercelMonitors: true, |
| 222 | + telemetry: false, |
| 223 | +}); |
0 commit comments