-
Notifications
You must be signed in to change notification settings - Fork 145
/
gatsby-browser.js
32 lines (27 loc) · 1.01 KB
/
gatsby-browser.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from "react"
import { config as fontAwesomeConfig } from "@fortawesome/fontawesome-svg-core"
import * as Sentry from "@sentry/browser"
import amplitude from "amplitude-js"
import { appVersion } from "./src/util/appVersion"
Sentry.init({
dsn: "https://[email protected]/1422325",
environment: process.env.NODE_ENV,
enabled: (() =>
["production", "stage"].indexOf(process.env.NODE_ENV) !== -1)(),
release: appVersion,
})
Sentry.configureScope(scope => {
scope.setTag("commit", process.env.ELECT_LIVE_SHA)
})
amplitude.getInstance().init("4cac840317d8c141fff5beb87b423d59")
/**
* Replaces the component renderer in a way that,
* as long as we are on the same page, the component will
* not be unmounted and remounted.
*/
export function replaceComponentRenderer({ props, loader }) {
const Component = props.pageResources.component
return <Component {...props} pathContext={props.pageContext} />
}
// CSS is added in `src/styles/global.css`
fontAwesomeConfig.autoAddCss = false