Skip to content

Commit

Permalink
Merge branch 'GDSC-Hongik:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
GDSChongik authored Aug 25, 2024
2 parents 6c09763 + af2ad1c commit 7a1e89d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/constants/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export const {
VITE_ACCESS_TOKEN: ACCESS_TOKEN,
VITE_CLIENT_KEY: CLIENT_KEY,
REACT_APP_SECURE_LOCAL_STORAGE_HASH_KEY: SECURE_KEY,
SENTRY_DSN_KEY: SENTRY_DSN_KEY,
VITE_SENTRY_DSN_KEY: VITE_SENTRY_DSN_KEY,
SENTRY_AUTH_TOKEN: SENTRY_AUTH_TOKEN
} = import.meta.env;
5 changes: 3 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import sentry from '@utils/sentry';
/* eslint-disable import/namespace */
import * as Sentry from '@sentry/react';
import sentry from './utils/sentry';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

import BottomSheetProvider from './components/provider/BottomSheetProvider';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { Routers } from '@/routes';
import { GlobalStyle } from '@/styles';
import { Global } from '@emotion/react';
import { ToastContainer } from 'react-toastify';
import './styles/styles.scss';

try {
sentry.initSentry();
} catch (error: unknown) {
Expand Down
14 changes: 10 additions & 4 deletions src/utils/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/namespace */
import { useEffect } from 'react';
import * as Sentry from '@sentry/react';
import {
Expand All @@ -6,25 +7,30 @@ import {
useLocation,
useNavigationType
} from 'react-router-dom';
import { SENTRY_DSN_KEY } from '@/constants/environment';
import { VITE_SENTRY_DSN_KEY } from '@/constants/environment';

const setSentry = () => {
function initSentry() {
if (process.env.NODE_ENV === 'development') return;

Sentry.init({
environment: process.env.VERCEL_ENV,
dsn: SENTRY_DSN_KEY,
environment: process.env.NODE_ENV,
dsn: VITE_SENTRY_DSN_KEY,
tracesSampleRate: 1.0,
tracePropagationTargets: [
'localhost',
/^https:\/\/(?:dev-|local-)?onboarding\.gdschongik\.com(?:\/.*)/,
/^https:\/\/(?:dev-)?api\.gdschongik\.com(?:\/.*)/
],
integrations: [
Sentry.browserTracingIntegration(),
Sentry.reactRouterV6BrowserTracingIntegration({
useEffect,
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes
}),
// eslint-disable-next-line import/namespace
Sentry.replayIntegration()
],

Expand Down
30 changes: 17 additions & 13 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import tsconfigPaths from 'vite-tsconfig-paths';

import { sentryVitePlugin } from '@sentry/vite-plugin';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths(), sentryVitePlugin({
org: process.env.SENTRY_ORG_NAME,
project: process.env.SENTRY_PROJECT_NAME,
authToken: process.env.SENTRY_AUTH_TOKEN,
sourcemaps: {
assets: './dist/**',
filesToDeleteAfterUpload: '**/*.map'
}
}), sentryVitePlugin({
org: "gdsc-hongik",
project: "wow-onboarding"
})],
plugins: [
react(),
tsconfigPaths(),
sentryVitePlugin({
org: process.env.VITE_SENTRY_ORG_NAME,
project: process.env.VITE_SENTRY_PROJECT_NAME,
authToken: process.env.VITE_SENTRY_AUTH_TOKEN,
sourcemaps: {
assets: './dist/**',
filesToDeleteAfterUpload: '**/*.map'
}
}),
sentryVitePlugin({
org: 'gdsc-hongik',
project: 'wow-onboarding'
})
],
build: {
sourcemap: true
}
Expand Down

0 comments on commit 7a1e89d

Please sign in to comment.