Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import * as Sentry from '@sentry/react';
import { createRoot } from 'react-dom/client';
import App from './App';

async function bootstrap() {
const mode = import.meta.env.MODE;
if (mode === 'init-only') {
const { initSentry } = await import('./sentry/init-only');
initSentry();
} else if (mode === 'tracing-replay') {
const { initSentry } = await import('./sentry/tracing-replay');
initSentry();
}
// 'no-sentry' mode: do not import any sentry module — the dynamic-import
// branches above are unreachable and Vite drops them from the bundle.

const root = createRoot(document.getElementById('root')!);
root.render(<App />);
if (import.meta.env.MODE === 'tracing-replay') {
Sentry.init({
dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined,
release: 'lighthouse-fixture',
environment: 'qa',
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
tracesSampleRate: 1.0,
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
});
} else if (import.meta.env.MODE === 'init-only') {
// enabled: false makes the SDK a guaranteed no-op (no transport allocation,
// no DSN warning). We're measuring pure SDK-loading + tree-shaking cost.
Sentry.init({ enabled: false });
}
// 'no-sentry' mode: both branches above are statically dead, so Vite drops
// the @sentry/react import entirely from the bundle.

void bootstrap();
const root = createRoot(document.getElementById('root')!);
root.render(<App />);

This file was deleted.

This file was deleted.

This file was deleted.

Loading