Skip to content
Open
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
3 changes: 3 additions & 0 deletions apps/web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ template

.idea
tsconfig.tsbuildinfo

# Sentry Config File
.env.sentry-build-plugin
2 changes: 2 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"@rematch/core": "2.2.0",
"@rematch/loading": "2.1.2",
"@rematch/select": "3.1.2",
"@sentry/react": "9.5.0",
"@sentry/vite-plugin": "3.2.2",
"@tanstack/react-query": "5.29.2",
"@uniswap/token-lists": "1.0.0-beta.30",
"@vitejs/plugin-react": "4.2.1",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/constants/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SupportedChainId as NetworkId } from '@balancednetwork/balanced-js';

export const NETWORK_ID: NetworkId = parseInt(import.meta.env.VITE_NETWORK_ID ?? '1');
export const SENTRY_DSN = import.meta.env.VITE_SENTRY_DSN;
7 changes: 7 additions & 0 deletions apps/web/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import ReactDOM from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import * as Sentry from '@sentry/react';

import { App } from '@/app';
import store from '@/store';
import { XWagmiProviders } from '@balancednetwork/xwagmi';
import { LanguageProvider } from './i18n';

import { SENTRY_DSN } from './constants/config';

// Use consistent styling
import 'sanitize.css/sanitize.css';

Expand All @@ -33,6 +36,10 @@ BigInt.prototype['toJSON'] = function () {
BigNumber.config({ FORMAT: fmt, ROUNDING_MODE: BigNumber.ROUND_DOWN });
BigNumber.set({ ROUNDING_MODE: BigNumber.ROUND_DOWN }); // equivalent

Sentry.init({
dsn: SENTRY_DSN,
});

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Provider store={store}>
Expand Down
10 changes: 10 additions & 0 deletions apps/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import nodePolyfills from 'vite-plugin-node-stdlib-browser';
import svgr from 'vite-plugin-svgr';
import viteTsconfigPaths from 'vite-tsconfig-paths';

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

export default defineConfig(({ command, mode }: ConfigEnv) => {
const env = loadEnv(mode, process.cwd(), '');

Expand All @@ -29,6 +31,11 @@ export default defineConfig(({ command, mode }: ConfigEnv) => {
}),
nodePolyfills(),
lingui(),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'sudoblock',
project: 'balanced-web',
}),
],
resolve: {
alias: {
Expand All @@ -48,5 +55,8 @@ export default defineConfig(({ command, mode }: ConfigEnv) => {
'process.env': env,
'process.version': JSON.stringify(''),
},
build: {
sourcemap: true,
},
};
});
Loading