2025-08-13 13:33:43 +08:00
|
|
|
import { resolve } from 'path'
|
2025-08-16 11:34:37 +08:00
|
|
|
import { defineConfig, externalizeDepsPlugin, bytecodePlugin } from 'electron-vite'
|
2025-08-13 13:33:43 +08:00
|
|
|
import vue from '@vitejs/plugin-vue'
|
2025-08-16 23:48:06 +08:00
|
|
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
2025-08-13 14:44:53 +08:00
|
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
|
|
|
import Components from 'unplugin-vue-components/vite'
|
|
|
|
|
import { TDesignResolver } from '@tdesign-vue-next/auto-import-resolver'
|
2025-08-17 23:21:53 +08:00
|
|
|
import wasm from 'vite-plugin-wasm'
|
|
|
|
|
import topLevelAwait from 'vite-plugin-top-level-await'
|
2025-08-13 13:33:43 +08:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
main: {
|
2025-08-14 13:12:04 +08:00
|
|
|
plugins: [
|
|
|
|
|
externalizeDepsPlugin({
|
|
|
|
|
exclude: ['@electron-toolkit/utils']
|
2025-08-16 11:34:37 +08:00
|
|
|
}),
|
|
|
|
|
bytecodePlugin()
|
2025-08-14 13:12:04 +08:00
|
|
|
]
|
2025-08-13 13:33:43 +08:00
|
|
|
},
|
|
|
|
|
preload: {
|
2025-08-14 13:12:04 +08:00
|
|
|
plugins: [
|
|
|
|
|
externalizeDepsPlugin({
|
|
|
|
|
exclude: ['@electron-toolkit/preload']
|
2025-08-16 11:34:37 +08:00
|
|
|
}),
|
|
|
|
|
bytecodePlugin()
|
2025-08-14 13:12:04 +08:00
|
|
|
]
|
2025-08-13 13:33:43 +08:00
|
|
|
},
|
|
|
|
|
renderer: {
|
2025-08-13 14:44:53 +08:00
|
|
|
plugins: [
|
|
|
|
|
vue(),
|
2025-08-16 23:48:06 +08:00
|
|
|
vueDevTools(),
|
2025-08-17 23:21:53 +08:00
|
|
|
wasm(),
|
|
|
|
|
topLevelAwait(),
|
2025-08-13 14:44:53 +08:00
|
|
|
AutoImport({
|
|
|
|
|
resolvers: [
|
|
|
|
|
TDesignResolver({
|
|
|
|
|
library: 'vue-next'
|
|
|
|
|
})
|
|
|
|
|
]
|
|
|
|
|
}),
|
|
|
|
|
Components({
|
|
|
|
|
resolvers: [
|
|
|
|
|
TDesignResolver({
|
|
|
|
|
library: 'vue-next'
|
|
|
|
|
})
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
],
|
2025-08-13 13:33:43 +08:00
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
2025-08-16 15:37:53 +08:00
|
|
|
'@renderer': resolve('src/renderer/src'),
|
2025-08-16 23:48:06 +08:00
|
|
|
'@assets': resolve('src/renderer/src/assets'),
|
2025-08-16 15:37:53 +08:00
|
|
|
'@components': resolve('src/renderer/src/components'),
|
|
|
|
|
'@services': resolve('src/renderer/src/services'),
|
|
|
|
|
'@types': resolve('src/renderer/src/types'),
|
|
|
|
|
'@store': resolve('src/renderer/src/store')
|
2025-08-13 13:33:43 +08:00
|
|
|
}
|
2025-08-16 13:02:39 +08:00
|
|
|
},
|
|
|
|
|
build: {
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
external: [
|
|
|
|
|
'fs',
|
|
|
|
|
'path',
|
|
|
|
|
'os',
|
|
|
|
|
'http',
|
|
|
|
|
'https',
|
|
|
|
|
'url',
|
|
|
|
|
'net',
|
|
|
|
|
'tls',
|
|
|
|
|
'crypto',
|
|
|
|
|
'stream',
|
|
|
|
|
'util',
|
|
|
|
|
'child_process',
|
|
|
|
|
'assert',
|
|
|
|
|
'dns',
|
|
|
|
|
'querystring',
|
|
|
|
|
'async_hooks',
|
|
|
|
|
'zlib'
|
|
|
|
|
]
|
|
|
|
|
}
|
2025-08-13 14:44:53 +08:00
|
|
|
}
|
2025-08-13 13:33:43 +08:00
|
|
|
}
|
|
|
|
|
})
|