mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-18 16:45:11 +00:00
756b5a766f
* First try * Lint and format * Use edge runtime * Use envs for sentry * Fix type * Fix upload of sourcemaps * Try fixing monitoring calls * Fix gitbook/monitoring in middleware * test error in middleware * Define context on sentry data * Set SENTRY_ENVIRONMENT to preview or production * Format * Pass url and userAgent * Remove test cases * Disable debug * Remove ignoreBuildErrors
28 lines
944 B
JavaScript
28 lines
944 B
JavaScript
const { withSentryConfig } = require('@sentry/nextjs');
|
|
|
|
module.exports = withSentryConfig(
|
|
{
|
|
env: {
|
|
BUILD_VERSION: (process.env.GITHUB_SHA ?? '').slice(0, 7),
|
|
SENTRY_DSN: process.env.SENTRY_DSN ?? '',
|
|
SENTRY_ENVIRONMENT: process.env.SENTRY_ENVIRONMENT ?? 'development',
|
|
},
|
|
},
|
|
{
|
|
silent: true,
|
|
org: 'gitbook-x',
|
|
project: 'gitbook-open',
|
|
},
|
|
{
|
|
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
|
widenClientFileUpload: true,
|
|
transpileClientSDK: false,
|
|
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
|
|
tunnelRoute: '/~gitbook/monitoring',
|
|
// Don't hide source maps from generated client bundles
|
|
hideSourceMaps: false,
|
|
disableLogger: true,
|
|
automaticVercelMonitors: false,
|
|
},
|
|
);
|