mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +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
|
run: npm ci
|
||||||
- name: Build Cef-html
|
- name: Build Cef-html
|
||||||
env:
|
env:
|
||||||
SENTRY_URL: ${{ secrets.SentryUrl }}
|
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SentryAuthToken }}
|
SENTRY_AUTH_TOKEN: ${{ secrets.SentryAuthToken }}
|
||||||
run: npm run prod
|
run: npm run prod
|
||||||
- name: Upload Cef-html artifacts
|
- name: Upload Cef-html artifacts
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ app.use(pinia);
|
|||||||
app.use(i18n);
|
app.use(i18n);
|
||||||
app.use(ElementPlus);
|
app.use(ElementPlus);
|
||||||
initComponents(app);
|
initComponents(app);
|
||||||
initSentry(app);
|
await initSentry(app);
|
||||||
|
|
||||||
app.mount('#root');
|
app.mount('#root');
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export async function initSentry(app) {
|
|||||||
app,
|
app,
|
||||||
dsn,
|
dsn,
|
||||||
environment: 'nightly',
|
environment: 'nightly',
|
||||||
|
release: version,
|
||||||
replaysSessionSampleRate: 0.1,
|
replaysSessionSampleRate: 0.1,
|
||||||
replaysOnErrorSampleRate: 1.0,
|
replaysOnErrorSampleRate: 1.0,
|
||||||
beforeSend(event, hint) {
|
beforeSend(event, hint) {
|
||||||
|
|||||||
@@ -3,22 +3,35 @@ import vue from '@vitejs/plugin-vue';
|
|||||||
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { dirname, resolve } from 'node:path';
|
import { dirname, resolve } from 'node:path';
|
||||||
|
import fs from 'node:fs';
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
const url = process.env.SENTRY_URL;
|
|
||||||
const authToken = process.env.SENTRY_AUTH_TOKEN;
|
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/
|
// https://vite.dev/config/
|
||||||
export default defineConfig(() => ({
|
export default defineConfig(() => ({
|
||||||
base: '',
|
base: '',
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
url &&
|
buildAndUploadSourceMaps &&
|
||||||
sentryVitePlugin({
|
sentryVitePlugin({
|
||||||
url,
|
|
||||||
authToken,
|
authToken,
|
||||||
org: 'vrcx',
|
project: 'vrcx-web',
|
||||||
project: 'vrcx-web'
|
release: {
|
||||||
|
name: vrcxVersion
|
||||||
|
},
|
||||||
|
sourcemaps: {
|
||||||
|
assets: './build/html/**',
|
||||||
|
filesToDeleteAfterUpload: './build/html/**/*.js.map'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
define: {
|
define: {
|
||||||
@@ -42,6 +55,6 @@ export default defineConfig(() => ({
|
|||||||
vr: resolve(__dirname, 'vr.html')
|
vr: resolve(__dirname, 'vr.html')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sourcemap: true
|
sourcemap: buildAndUploadSourceMaps
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user