This commit is contained in:
Stephen Zhou 2026-03-24 16:04:05 +08:00
parent 0bf95fda09
commit d9fcfc955b
No known key found for this signature in database
1 changed files with 16 additions and 16 deletions

View File

@ -2,22 +2,6 @@ import { IS_DEV } from '@/config'
import { env } from '@/env'
async function main() {
const SENTRY_DSN = env.NEXT_PUBLIC_SENTRY_DSN
if (!IS_DEV && SENTRY_DSN) {
const Sentry = await import('@sentry/react')
Sentry.init({
dsn: SENTRY_DSN,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
],
tracesSampleRate: 0.1,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
})
}
// Polyfill for Array.prototype.toSpliced (ES2023, Chrome 110+)
if (!Array.prototype.toSpliced) {
// eslint-disable-next-line no-extend-native
@ -76,6 +60,22 @@ async function main() {
value: sessionStorage,
})
}
const SENTRY_DSN = env.NEXT_PUBLIC_SENTRY_DSN
if (!IS_DEV && SENTRY_DSN) {
const Sentry = await import('@sentry/react')
Sentry.init({
dsn: SENTRY_DSN,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
],
tracesSampleRate: 0.1,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
})
}
}
main()