From f5e1885ffab8ff6d946f86e8dbc67e62c74d74fd Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Sat, 14 Jun 2025 10:01:47 +0800 Subject: [PATCH] chore(electron.vite.config): update Rollup configuration for single file packaging (#7183) - Modified the Rollup options to disable code splitting and enable inline dynamic imports, ensuring a single file output for the build process. This change optimizes the packaging of the Electron application. --- electron.vite.config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 7f4a4e3a66..9b22ffc33b 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -19,7 +19,13 @@ export default defineConfig({ }, build: { rollupOptions: { - external: ['@libsql/client', 'bufferutil', 'utf-8-validate'] + external: ['@libsql/client', 'bufferutil', 'utf-8-validate'], + output: { + // 彻底禁用代码分割 - 返回 null 强制单文件打包 + manualChunks: undefined, + // 内联所有动态导入,这是关键配置 + inlineDynamicImports: true + } }, sourcemap: process.env.NODE_ENV === 'development' },