From 3c8a593be778b92d76944ec997400987c955a8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 22:54:50 -0400 Subject: [PATCH] docs(electron-vite): explain why zod is bundled into preload (P2-17) --- electron.vite.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 3cbd8227..62cd48a9 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -29,6 +29,9 @@ export default defineConfig({ }, }, 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: {