Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const CracoLessPlugin = require("craco-less")
const webpack = require("webpack")
const path = require("path")
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const SentryWebpackPlugin = require("@sentry/webpack-plugin")
// const SentryWebpackPlugin = require("@sentry/webpack-plugin")
require("./scripts/download-blog-posts.data.json.js")

module.exports = {
Expand Down Expand Up @@ -85,11 +85,11 @@ module.exports = {
})

if (env === "production" && process.env.CI) {
const sentryPlugin = new SentryWebpackPlugin({
include: "./build",
release: process.env.REACT_APP_VERSION,
})
webpackConfig.plugins.push(sentryPlugin)
// const sentryPlugin = new SentryWebpackPlugin({
// include: "./build",
// release: process.env.REACT_APP_VERSION,
// })
// webpackConfig.plugins.push(sentryPlugin)

const instanceOfMiniCssExtractPlugin = webpackConfig.plugins.find(plugin => plugin instanceof MiniCssExtractPlugin)
instanceOfMiniCssExtractPlugin.options.ignoreOrder = true
Expand Down
46 changes: 23 additions & 23 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Sentry from "@sentry/react"
// import * as Sentry from "@sentry/react"
import { isMobile } from "react-device-detect"
import ReactDOM from "react-dom/client"
import ReactGA from "react-ga4"
Expand All @@ -25,28 +25,28 @@ window.addEventListener("unhandledrejection", function (event) {
})

if (requireEnv("NODE_ENV") === "production") {
Sentry.init({
environment: requireEnv("REACT_APP_SCROLL_ENVIRONMENT"),
dsn: requireEnv("REACT_APP_SENTRY_DSN"),
autoSessionTracking: false,
integrations: [
new Sentry.Integrations.Breadcrumbs({
console: false,
dom: false,
fetch: false,
history: false,
sentry: false,
xhr: false,
}),
],
tracesSampleRate: 1.0,
beforeSend(event) {
if (!event.exception) {
return null
}
return event
},
})
// Sentry.init({
// environment: requireEnv("REACT_APP_SCROLL_ENVIRONMENT"),
// dsn: requireEnv("REACT_APP_SENTRY_DSN"),
// autoSessionTracking: false,
// integrations: [
// new Sentry.Integrations.Breadcrumbs({
// console: false,
// dom: false,
// fetch: false,
// history: false,
// sentry: false,
// xhr: false,
// }),
// ],
// tracesSampleRate: 1.0,
// beforeSend(event) {
// if (!event.exception) {
// return null
// }
// return event
// },
// })

const GOOGLE_ANALYTICS_ID: string | undefined = requireEnv("REACT_APP_GOOGLE_ANALYTICS_ID")
if (typeof GOOGLE_ANALYTICS_ID === "string") {
Expand Down