2022-04-16 13:30:25 +08:00
|
|
|
import './utils/initLog'
|
2022-04-17 12:46:06 +08:00
|
|
|
import './utils/theme'
|
2022-03-13 14:40:38 +08:00
|
|
|
import { StrictMode } from 'react'
|
2022-04-02 19:29:43 +08:00
|
|
|
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'
|
2022-04-17 12:46:06 +08:00
|
|
|
import './styles/accentColor.scss'
|
2022-03-13 14:40:38 +08:00
|
|
|
import App from './App'
|
2022-03-29 16:52:53 +08:00
|
|
|
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
|
|
|
|
2022-04-20 20:25:20 +08:00
|
|
|
ipcRenderer()
|
|
|
|
|
2022-04-02 19:29:43 +08:00
|
|
|
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>
|
2022-04-02 19:29:43 +08:00
|
|
|
</StrictMode>
|
2022-03-13 14:40:38 +08:00
|
|
|
)
|