Skip to content

Commit

Permalink
Merge pull request #1147 from oraidex/add-source-map-sentry
Browse files Browse the repository at this point in the history
add source map sentry
  • Loading branch information
haunv3 authored Feb 5, 2025
2 parents 539c306 + fee268d commit 5c17bfa
Show file tree
Hide file tree
Showing 5 changed files with 260 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ public/injected-provider.bundle.js

# for Yarn 3
.yarn
*.scss.d.ts
*.scss.d.ts
# Sentry Config File
.env.sentry-build-plugin
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"@oraichain/ethereum-multicall": "^1.0.2",
"@oraichain/kawaiiverse-txs": "^0.0.3",
"@oraichain/orai-bitcoin": "2.0.0",
"@oraichain/oraidex-common": "2.0.6",
"@oraichain/orai-token-inspector": "^0.2.14",
"@oraichain/oraidex-common": "2.0.6",
"@oraichain/oraidex-common-ui": "1.0.11",
"@oraichain/oraidex-contracts-sdk": "1.0.55",
"@oraichain/oraidex-universal-swap": "1.3.1",
Expand All @@ -38,6 +38,7 @@
"@react-spring/web": "^9.7.5",
"@reduxjs/toolkit": "^1.9.3",
"@sentry/react": "7.99.0",
"@sentry/vite-plugin": "^3.1.2",
"@solana/spl-token": "^0.4.9",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
Expand Down Expand Up @@ -138,7 +139,7 @@
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"start": "vite",
"build": "NODE_OPTIONS='--max-old-space-size=15000' vite build",
"build": "NODE_OPTIONS='--max-old-space-size=20480' vite build",
"serve": "vite serve",
"ts-check": "tsc --noEmit",
"postinstall": "patch-package",
Expand Down
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ if (import.meta.env.VITE_APP_SENTRY_ENVIRONMENT === 'production') {
Sentry.init({
environment: import.meta.env.VITE_APP_SENTRY_ENVIRONMENT,
dsn: 'https://[email protected]/6580749',
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
replaysOnErrorSampleRate: 1.0,
denyUrls: [
/extensions\//i,
/extension/i,
Expand Down
20 changes: 18 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { sentryVitePlugin } from '@sentry/vite-plugin';
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import viteTsconfigPaths from 'vite-tsconfig-paths';
Expand All @@ -8,7 +9,17 @@ import path from 'path';

export default defineConfig({
base: '',
plugins: [react(), wasm(), viteTsconfigPaths(), svgr(), nodePolyfills()],
plugins: [
react(),
wasm(),
viteTsconfigPaths(),
svgr(),
nodePolyfills(),
sentryVitePlugin({
org: 'oraichain',
project: 'oraidex'
})
],
server: {
open: true,
port: 3000
Expand Down Expand Up @@ -36,7 +47,12 @@ export default defineConfig({
build: {
commonjsOptions: { transformMixedEsModules: true },
outDir: path.resolve(__dirname, 'build'),
rollupOptions: {},
sourcemap: true,
rollupOptions: {
output: {
sourcemap: true
}
},
target: 'esnext'
},
optimizeDeps: {
Expand Down
Loading

0 comments on commit 5c17bfa

Please sign in to comment.