Skip to content

Commit

Permalink
sentry: Configure vite to pass source maps to Sentry automatically
Browse files Browse the repository at this point in the history
Those source maps are used by Sentry to unminify code and allow better stack tracing inside it.
  • Loading branch information
rafaellehmkuhl committed Nov 28, 2024
1 parent 44224bb commit f4a390f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ cypress/fixtures/
cypress/videos/
cypress/screenshots/

*.log
*.log

# Sentry Config File
.env.sentry-build-plugin
9 changes: 9 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { sentryVitePlugin } from '@sentry/vite-plugin'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { defineConfig } from 'vite'
Expand All @@ -12,6 +13,9 @@ const isElectron = process.env.ELECTRON === 'true'
const isBuilding = process.argv.includes('build')

export default defineConfig({
build: {
sourcemap: true,
},
plugins: [
(isElectron || isBuilding) &&
electron({
Expand All @@ -30,6 +34,11 @@ export default defineConfig({
startup()
},
}),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'blue-robotics-c7',
project: 'cockpit-frontend-production',
}),
vue(),
vuetify({
autoImport: true,
Expand Down

0 comments on commit f4a390f

Please sign in to comment.