index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //全局变量
  2. import './Global'
  3. import React from 'react';
  4. import ReactDOM from 'react-dom/client';
  5. import App from './App';
  6. import {BrowserRouter} from 'react-router-dom';
  7. import {ThemeProvider} from '@contexts/themeContext';
  8. import {ShopProvider} from '@contexts/shopContext';
  9. import {Provider} from 'react-redux';
  10. import store from './app/store';
  11. import * as Sentry from "@sentry/react";
  12. Sentry.init({
  13. dsn: "https://4686ef0d926e140fb482e63efcde1cdf@o4507102375641088.ingest.us.sentry.io/4507102380687360",
  14. integrations: [
  15. Sentry.browserTracingIntegration(),
  16. Sentry.replayIntegration(),
  17. ],
  18. // Performance Monitoring
  19. tracesSampleRate: 1.0, // Capture 100% of the transactions
  20. // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
  21. tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
  22. // Session Replay
  23. replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
  24. replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
  25. });
  26. const root = ReactDOM.createRoot(document.getElementById('root'));
  27. root.render(
  28. <Provider store={store}>
  29. <BrowserRouter>
  30. <ThemeProvider>
  31. <ShopProvider>
  32. <App/>
  33. </ShopProvider>
  34. </ThemeProvider>
  35. </BrowserRouter>
  36. </Provider>
  37. );