Files
AgentCompany/electron.vite.config.ts
T
ZacharyZhang-NY 76d9031a41 Reorganize worker entry layer into worker/entry/ (M8 part 1/3)
Pulls the worker process entry point, parent<->worker IPC plumbing, message validation schema, and crash-recovery handler into a single src/main/worker/entry/ module. No runtime behavior changes — only directory + file-name renames plus import-path updates: worker-entry.ts -> entry/index.ts, worker-message-handler.ts -> entry/message-handler.ts, worker-rpc.ts -> entry/rpc.ts, worker-crash-recovery.ts -> entry/crash-recovery.ts, worker-types.ts -> entry/types.ts. electron.vite.config.ts, worker-service.ts, handlers/*.ts, pi-agent-factory.ts, and worker-runner.ts updated to point at the new locations.
2026-04-20 11:38:46 -04:00

58 lines
1.4 KiB
TypeScript

import { resolve } from "node:path";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
resolve: {
alias: {
"@shared": resolve("src/shared"),
"@main": resolve("src/main"),
},
},
build: {
rollupOptions: {
input: {
index: resolve("src/main/index.ts"),
worker: resolve("src/main/worker/entry/index.ts"),
},
},
},
},
preload: {
// zod is bundled into preload because preload runs as sandboxed CJS
// and cannot resolve externalized ESM deps at runtime. Inlining keeps
// IPC Zod validation working inside the preload layer.
plugins: [externalizeDepsPlugin({ exclude: ["zod"] })],
resolve: {
alias: {
"@shared": resolve("src/shared"),
"@preload": resolve("src/preload"),
},
},
build: {
rollupOptions: {
input: {
index: resolve("src/preload/index.ts"),
},
output: {
format: "cjs",
entryFileNames: "[name].js",
chunkFileNames: "chunks/[name]-[hash].js",
},
},
},
},
renderer: {
resolve: {
alias: {
"@shared": resolve("src/shared"),
"@renderer": resolve("src/renderer"),
},
},
plugins: [react(), tailwindcss()],
},
});