2
0

💚 Fix docker build when Sentry not enabled

This commit is contained in:
Baptiste Arnaud
2023-10-10 15:04:17 +02:00
parent 49826d1303
commit 54788a828e
4 changed files with 56 additions and 51 deletions

View File

@ -134,32 +134,34 @@ const nextConfig = {
},
}
export default withSentryConfig(
nextConfig,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
export default process.env.NEXT_PUBLIC_SENTRY_DSN
? withSentryConfig(
nextConfig,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
// Suppresses source map uploading logs during build
silent: true,
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-viewer',
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
// Suppresses source map uploading logs during build
silent: true,
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-viewer',
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: '/monitoring',
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: '/monitoring',
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
)
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
)
: nextConfig