How not to use Sentry (raven-js) in development mode?

When I’m in development mode, I don’t want to use at all Sentry for two reasons:

  • I don’t need it/don’t want to collect it
  • I don’t want that my devtools display raven.min.js as sourcemaps when I’ve got a bug, I prefer to display MY files as source.

So I did this:

if (process.env.NODE_ENV === "development") {
  // fake Raven
  Raven = {
    captureException: () => {},
    setUserContext: () => {},
  }

  render(App)
}
else {
  Raven.config(SENTRY_TOKEN).install()
  Raven.context(() => { render(App) })
}

Do you see a better way?

Thank you.

PS: disabling sentry to send errors isn’t enough