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 : {
@@ -61,13 +79,14 @@ export default defineConfig({
6179 } ,
6280 } ,
6381 renderer : {
64- plugins : [ appPlugin ] ,
82+ plugins : [ appPlugin , sentry ] ,
6583 publicDir : "../../../app/public" ,
6684 root : "src/renderer" ,
6785 define : {
6886 "import.meta.env.VITE_OPENCODE_CHANNEL" : JSON . stringify ( channel ) ,
6987 } ,
7088 build : {
89+ sourcemap : true ,
7190 rollupOptions : {
7291 input : {
7392 main : "src/renderer/index.html" ,
0 commit comments