mirror of
https://github.com/vrcx-team/VRCX.git
synced 2026-04-06 00:32:02 +02:00
Sentry config
This commit is contained in:
1
.github/workflows/github_actions.yml
vendored
1
.github/workflows/github_actions.yml
vendored
@@ -122,7 +122,6 @@ jobs:
|
||||
run: npm ci
|
||||
- name: Build Cef-html
|
||||
env:
|
||||
SENTRY_URL: ${{ secrets.SentryUrl }}
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SentryAuthToken }}
|
||||
run: npm run prod
|
||||
- name: Upload Cef-html artifacts
|
||||
|
||||
@@ -20,7 +20,7 @@ app.use(pinia);
|
||||
app.use(i18n);
|
||||
app.use(ElementPlus);
|
||||
initComponents(app);
|
||||
initSentry(app);
|
||||
await initSentry(app);
|
||||
|
||||
app.mount('#root');
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ export async function initSentry(app) {
|
||||
app,
|
||||
dsn,
|
||||
environment: 'nightly',
|
||||
release: version,
|
||||
replaysSessionSampleRate: 0.1,
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
beforeSend(event, hint) {
|
||||
|
||||
@@ -3,22 +3,35 @@ import vue from '@vitejs/plugin-vue';
|
||||
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const url = process.env.SENTRY_URL;
|
||||
|
||||
const authToken = process.env.SENTRY_AUTH_TOKEN;
|
||||
const buildAndUploadSourceMaps = authToken ? true : false;
|
||||
const vrcxVersion = fs
|
||||
.readFileSync(resolve(__dirname, '../Version'), 'utf-8')
|
||||
.trim();
|
||||
if (buildAndUploadSourceMaps) {
|
||||
console.log('Source maps will be built and uploaded to Sentry');
|
||||
}
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(() => ({
|
||||
base: '',
|
||||
plugins: [
|
||||
vue(),
|
||||
url &&
|
||||
buildAndUploadSourceMaps &&
|
||||
sentryVitePlugin({
|
||||
url,
|
||||
authToken,
|
||||
org: 'vrcx',
|
||||
project: 'vrcx-web'
|
||||
project: 'vrcx-web',
|
||||
release: {
|
||||
name: vrcxVersion
|
||||
},
|
||||
sourcemaps: {
|
||||
assets: './build/html/**',
|
||||
filesToDeleteAfterUpload: './build/html/**/*.js.map'
|
||||
}
|
||||
})
|
||||
],
|
||||
define: {
|
||||
@@ -42,6 +55,6 @@ export default defineConfig(() => ({
|
||||
vr: resolve(__dirname, 'vr.html')
|
||||
}
|
||||
},
|
||||
sourcemap: true
|
||||
sourcemap: buildAndUploadSourceMaps
|
||||
}
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user