1+ import { sentryVitePlugin } from "@sentry/vite-plugin"
12import { defineConfig } from "electron-vite"
23import appPlugin from "@opencode-ai/app/vite"
34import * as fs from "node:fs/promises"
@@ -12,6 +13,23 @@ const OPENCODE_SERVER_DIST = "../opencode/dist/node"
1213
1314const nodePtyPkg = `@lydell/node-pty-${ process . platform } -${ process . arch } `
1415
16+ const sentry =
17+ process . env . SENTRY_AUTH_TOKEN && process . env . SENTRY_ORG && process . env . SENTRY_PROJECT
18+ ? sentryVitePlugin ( {
19+ authToken : process . env . SENTRY_AUTH_TOKEN ,
20+ org : process . env . SENTRY_ORG ,
21+ project : process . env . SENTRY_PROJECT ,
22+ telemetry : false ,
23+ release : {
24+ name : process . env . SENTRY_RELEASE ?? process . env . VITE_SENTRY_RELEASE ,
25+ } ,
26+ sourcemaps : {
27+ assets : "./out/renderer/**" ,
28+ filesToDeleteAfterUpload : "./out/renderer/**/*.map" ,
29+ } ,
30+ } )
31+ : false
32+
1533export default defineConfig ( {
1634 main : {
1735 define : {
@@ -57,13 +75,14 @@ export default defineConfig({
5775 } ,
5876 } ,
5977 renderer : {
60- plugins : [ appPlugin ] ,
78+ plugins : [ appPlugin , sentry ] ,
6179 publicDir : "../../../app/public" ,
6280 root : "src/renderer" ,
6381 define : {
6482 "import.meta.env.VITE_OPENCODE_CHANNEL" : JSON . stringify ( channel ) ,
6583 } ,
6684 build : {
85+ sourcemap : true ,
6786 rollupOptions : {
6887 input : {
6988 main : "src/renderer/index.html" ,
0 commit comments