Skip to content

Commit

Permalink
chore(bridge-ui): uploading source maps to Sentry (#13974)
Browse files Browse the repository at this point in the history
  • Loading branch information
jscriptcoder authored Jun 13, 2023
1 parent 50a1034 commit 3895f0a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { chains } from '../../chain/chains';
import { bridgeABI } from '../../constants/abi';
import { BridgeType } from '../../domain/bridge';
import type { Chain, ChainID } from '../../domain/chain';
import type { ChainID } from '../../domain/chain';
import { MessageStatus } from '../../domain/message';
import type { NoticeOpenArgs } from '../../domain/modal';
import {
Expand Down
8 changes: 5 additions & 3 deletions packages/bridge-ui/src/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ const environment =

const isProd = environment === 'production';

export function setupSentry(dsn: string) {
export function setupSentry(dsn?: string) {
if (!dsn) return;

Sentry.init({
dsn,
environment,

integrations: [new Sentry.BrowserTracing()],

sampleRate: isProd ? 0.6 : 1.0,
tracesSampleRate: isProd ? 0.6 : 1.0,
sampleRate: isProd ? 0.2 : 1.0,
tracesSampleRate: isProd ? 0.2 : 1.0,
maxBreadcrumbs: 50,

beforeSend(event, hint) {
Expand Down
20 changes: 12 additions & 8 deletions packages/bridge-ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { sentryVitePlugin } from '@sentry/vite-plugin';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import polyfillNode from 'rollup-plugin-polyfill-node';
import { defineConfig } from 'vite';

// https://vitejs.dev/config/
export default defineConfig({
define: {
global: 'globalThis',
'process.env.NODE_DEBUG': false,
'process.env.LINK_API_URL': false,
'process.env.SDK_VERSION': "'unknown'",
},
plugins: [svelte(), polyfillNode()],
build: { sourcemap: true },
define: { global: 'globalThis' },
plugins: [
svelte(),
polyfillNode(),
sentryVitePlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
});

0 comments on commit 3895f0a

Please sign in to comment.