mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-10 16:58:59 +08:00
fix: remove sentry for community edtion and dev (#259)
This commit is contained in:
parent
75f7a96025
commit
54bb309d87
@ -1,5 +1,10 @@
|
||||
const { withSentryConfig } = require('@sentry/nextjs')
|
||||
|
||||
const EDITION = process.env.NEXT_PUBLIC_EDITION
|
||||
const IS_CE_EDITION = EDITION === 'SELF_HOSTED'
|
||||
const isDevelopment = process.env.NODE_ENV === 'development'
|
||||
const isHideSentry = isDevelopment || IS_CE_EDITION
|
||||
|
||||
const withMDX = require('@next/mdx')({
|
||||
extension: /\.mdx?$/,
|
||||
options: {
|
||||
@ -31,9 +36,6 @@ const nextConfig = {
|
||||
// https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
|
||||
ignoreBuildErrors: true,
|
||||
},
|
||||
sentry: {
|
||||
hideSourceMaps: true,
|
||||
},
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
@ -43,6 +45,13 @@ const nextConfig = {
|
||||
},
|
||||
]
|
||||
},
|
||||
...(isHideSentry
|
||||
? {}
|
||||
: {
|
||||
sentry: {
|
||||
hideSourceMaps: true,
|
||||
},
|
||||
}),
|
||||
}
|
||||
|
||||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup
|
||||
@ -54,8 +63,7 @@ const sentryWebpackPluginOptions = {
|
||||
assets: './**',
|
||||
ignore: ['./node_modules/**'],
|
||||
},
|
||||
|
||||
// https://github.com/getsentry/sentry-webpack-plugin#options.
|
||||
}
|
||||
|
||||
module.exports = withMDX(withSentryConfig(nextConfig, sentryWebpackPluginOptions))
|
||||
module.exports = isHideSentry ? withMDX(nextConfig) : withMDX(withSentryConfig(nextConfig, sentryWebpackPluginOptions))
|
||||
|
Loading…
x
Reference in New Issue
Block a user