YesPlayMusic/packages/web/main.tsx

42 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-04-16 13:30:25 +08:00
import './utils/initLog'
import './utils/theme'
2022-03-13 14:40:38 +08:00
import { StrictMode } from 'react'
import * as ReactDOMClient from 'react-dom/client'
2022-03-13 14:40:38 +08:00
import { BrowserRouter } from 'react-router-dom'
2022-03-27 15:21:48 +08:00
import * as Sentry from '@sentry/react'
import { BrowserTracing } from '@sentry/tracing'
2022-03-13 14:40:38 +08:00
import 'virtual:svg-icons-register'
2022-04-09 00:28:37 +08:00
import './styles/global.scss'
import './styles/accentColor.scss'
2022-03-13 14:40:38 +08:00
import App from './App'
import pkg from '../../package.json'
2022-04-16 13:31:05 +08:00
import ReactGA from 'react-ga4'
2022-05-12 02:45:43 +08:00
import { ipcRenderer } from './ipcRenderer'
2022-04-16 13:31:05 +08:00
ReactGA.initialize('G-KMJJCFZDKF')
2022-03-27 15:21:48 +08:00
Sentry.init({
dsn: 'https://7cc7879b42ba4bed9f66fb6752558475@o436528.ingest.sentry.io/6274630',
integrations: [new BrowserTracing()],
release: `yesplaymusic@${pkg.version}`,
2022-03-30 00:53:05 +08:00
environment: import.meta.env.MODE,
2022-03-27 15:21:48 +08:00
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
})
2022-03-13 14:40:38 +08:00
ipcRenderer()
const container = document.getElementById('root') as HTMLElement
const root = ReactDOMClient.createRoot(container)
root.render(
2022-03-13 14:40:38 +08:00
<StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</StrictMode>
2022-03-13 14:40:38 +08:00
)