mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02:00
Bring back upload source maps to Sentry GitOrigin-RevId: 22024e3ec2462d0bc9ad9c14e8d1c21880c55cd1
19 lines
652 B
JavaScript
19 lines
652 B
JavaScript
// Conditionally enable Sentry based on whether the DSN token is set
|
|
if (window.ExposedSettings.sentryDsn) {
|
|
import(/* webpackChunkName: "sentry" */ '@sentry/browser').then(Sentry => {
|
|
Sentry.init({
|
|
dsn: window.ExposedSettings.sentryDsn,
|
|
|
|
// Ignore errors unless they come from overleaf.com/sharelatex.com
|
|
// Adapted from: https://docs.sentry.io/platforms/javascript/#decluttering-sentry
|
|
whitelistUrls: [
|
|
/https:\/\/[a-z]+\.overleaf\.com/,
|
|
/https:\/\/[a-z]+\.sharelatex\.com/
|
|
]
|
|
})
|
|
|
|
// Previously Raven added itself as a global, so we mimic that old behaviour
|
|
window.Raven = Sentry
|
|
})
|
|
}
|