mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-11-30 16:02:58 +08:00
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { resolve } from 'path'
|
|
import { defineConfig } from 'electron-vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
const editionOutDir = process.env.TRACEMEMO_EDITION_OUT_DIR
|
|
|
|
export default defineConfig({
|
|
main: {
|
|
build: {
|
|
...(editionOutDir ? { outDir: editionOutDir } : {}),
|
|
rollupOptions: {
|
|
input: {
|
|
index: resolve('src/main/index.ts'),
|
|
/* 扩展后台宿主:由 `ExtensionHost` 以子进程方式 fork,不在主进程加载。 */
|
|
extensionHost: resolve('src/main/extensions/host-runtime.ts'),
|
|
reportTemplateTest: resolve('src/main/report-template-test-entry.ts'),
|
|
queryAgentPoc: resolve('src/main/query-agent-poc-entry.ts'),
|
|
voiceRecognitionWorker: resolve('src/main/voice-pipeline/voice-recognition-worker.ts'),
|
|
knowledgeWorker: resolve('src/main/knowledge/knowledge-worker.ts')
|
|
},
|
|
output: {
|
|
entryFileNames: '[name].js'
|
|
},
|
|
external: ['koffi', 'sherpa-onnx-node', '@napi-rs/system-ocr']
|
|
}
|
|
}
|
|
},
|
|
preload: editionOutDir ? { build: { outDir: editionOutDir } } : {},
|
|
renderer: {
|
|
...(editionOutDir ? { build: { outDir: editionOutDir } } : {}),
|
|
resolve: {
|
|
alias: {
|
|
'@renderer': resolve('src/renderer/src')
|
|
}
|
|
},
|
|
plugins: [react()]
|
|
}
|
|
})
|