2024-05-15 12:57:15 +08:00
|
|
|
import { resolve } from 'path'
|
|
|
|
|
import { defineConfig, externalizeDepsPlugin, bytecodePlugin } from 'electron-vite'
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
2025-04-10 20:16:51 +08:00
|
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
|
|
|
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
|
|
|
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
|
|
|
import Components from 'unplugin-vue-components/vite'
|
2024-05-15 12:57:15 +08:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
main: {
|
2025-04-10 20:16:51 +08:00
|
|
|
plugins: [externalizeDepsPlugin(), bytecodePlugin(), tsconfigPaths()]
|
2024-05-15 12:57:15 +08:00
|
|
|
},
|
|
|
|
|
discord: {
|
2025-04-10 20:16:51 +08:00
|
|
|
plugins: [externalizeDepsPlugin(), bytecodePlugin(), tsconfigPaths()]
|
2024-05-15 12:57:15 +08:00
|
|
|
},
|
|
|
|
|
preload: {
|
2025-04-10 20:16:51 +08:00
|
|
|
plugins: [externalizeDepsPlugin(), bytecodePlugin(), tsconfigPaths()]
|
2024-05-15 12:57:15 +08:00
|
|
|
},
|
|
|
|
|
renderer: {
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
2024-11-02 18:18:55 +08:00
|
|
|
'@renderer': resolve('src/renderer/src'),
|
2025-04-10 20:16:51 +08:00
|
|
|
'@': resolve('src/')
|
2024-05-15 12:57:15 +08:00
|
|
|
}
|
|
|
|
|
},
|
2025-04-10 20:16:51 +08:00
|
|
|
plugins: [
|
|
|
|
|
vue(),
|
|
|
|
|
AutoImport({
|
|
|
|
|
imports: [
|
|
|
|
|
'vue',
|
|
|
|
|
{
|
|
|
|
|
'naive-ui': ['useDialog', 'useMessage', 'useNotification', 'useLoadingBar']
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}),
|
|
|
|
|
Components({
|
|
|
|
|
resolvers: [NaiveUiResolver()],
|
|
|
|
|
// 不自动导入自己添加的组件
|
|
|
|
|
dirs: [] // 清空自动导入的目录,所有的自动导入都通过 resolvers 进行
|
|
|
|
|
})
|
|
|
|
|
]
|
2024-05-15 12:57:15 +08:00
|
|
|
}
|
|
|
|
|
})
|