Skip to content

Commit

Permalink
feat: Sentry 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
eunbeann committed Jan 15, 2024
1 parent e7b93de commit 7427bda
Show file tree
Hide file tree
Showing 5 changed files with 345 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ dist-ssr
*.sln
*.sw?

.env
.env
# Sentry Config File
.env.sentry-build-plugin
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@sentry/browser": "^7.93.0",
"@sentry/react": "^7.93.0",
"@sentry/vite-plugin": "^2.10.2",
"axios": "^1.6.5",
"eslint-plugin-react": "^7.33.2",
"lottie-react": "^2.4.0",
Expand Down
17 changes: 17 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
import * as Sentry from '@sentry/react';
import React from 'react';
import ReactDOM from 'react-dom/client';

import App from './App.tsx';

Sentry.init({
dsn: 'https://ff1721b5da5c3ed5ed8c4e4507b6ad51@o4506557086629888.ingest.sentry.io/4506573475741696',
integrations: [
new Sentry.BrowserTracing({
tracePropagationTargets: ['localhost', /^https:\/\/www\.lecue\.me/],
}),
new Sentry.Replay({
maskAllText: false,
blockAllMedia: false,
}),
],
tracesSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
Expand Down
13 changes: 11 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { sentryVitePlugin } from "@sentry/vite-plugin";
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import svgr from 'vite-plugin-svgr';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), svgr()],
plugins: [react(), svgr(), sentryVitePlugin({
org: "lecue",
project: "javascript-react"
})],

server: {
hmr: {
port: 3000,
},
},
});

build: {
sourcemap: true
}
});
Loading

0 comments on commit 7427bda

Please sign in to comment.