From 2f3a3c8c48b7c85285d8e13bb824d157e220a359 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Fri, 23 May 2025 15:41:55 +0800 Subject: [PATCH] refactor: remove manual chunking logic from Vite configuration - Eliminated custom output chunking strategy for worker files and node_modules from the electron Vite configuration. - Streamlined the configuration for improved maintainability and clarity. --- electron.vite.config.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index bcbb53d079..3d0f61a762 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -83,23 +83,6 @@ export default defineConfig({ input: { index: resolve(__dirname, 'src/renderer/index.html'), miniWindow: resolve(__dirname, 'src/renderer/miniWindow.html') - }, - output: { - manualChunks: (id: string) => { - // 检测所有 worker 文件,提取 worker 名称作为 chunk 名 - if (id.includes('.worker') && id.endsWith('?worker')) { - const workerName = id.split('/').pop()?.split('.')[0] || 'worker' - return `workers/${workerName}` - } - - // All node_modules are in the vendor chunk - if (id.includes('node_modules')) { - return 'vendor' - } - - // Other modules use default chunk splitting strategy - return undefined - } } } }