perf: optimize app startup and background lifecycles

This commit is contained in:
inman committed 2026-08-19 00:56:15 +08:00
1 parent 31332f6d76
commit 927e13349b
121 files changed
+4359 -1400

No files matched your search

+19
View File
@@ -82,6 +82,25 @@ export default defineConfig({
},
},
},
{
// CPU-heavy local release builds run in an Electron utility process.
// Keep the worker as an explicit package entry so the release path is
// inspectable and does not depend on a sibling source checkout.
entry: 'electron/services/release-utility-worker.ts',
onstart(options) {
// If this entry happens to finish the development build last, the
// normal Electron main process still needs to start.
options.startup();
},
vite: {
build: {
outDir: 'dist-electron/utility',
rollupOptions: {
external: isMainProcessExternal,
},
},
},
},
]),
!rendererOnly && renderer(),
].filter(Boolean),