tf_code/packages/desktop-electron/electron.vite.config.ts
2026-03-04 15:12:34 +08:00

42 lines
878 B
TypeScript

import { defineConfig } from "electron-vite"
import appPlugin from "@opencode-ai/app/vite"
const channel = (() => {
const raw = process.env.OPENCODE_CHANNEL
if (raw === "dev" || raw === "beta" || raw === "prod") return raw
return "dev"
})()
export default defineConfig({
main: {
define: {
"import.meta.env.OPENCODE_CHANNEL": JSON.stringify(channel),
},
build: {
rollupOptions: {
input: { index: "src/main/index.ts" },
},
},
},
preload: {
build: {
rollupOptions: {
input: { index: "src/preload/index.ts" },
},
},
},
renderer: {
plugins: [appPlugin],
publicDir: "../app/public",
root: "src/renderer",
build: {
rollupOptions: {
input: {
main: "src/renderer/index.html",
loading: "src/renderer/loading.html",
},
},
},
},
})