Some checks are pending
Security Checks / security (push) Waiting to run
统一 frontend、backend、test、test-log 和 out 目录,更新构建、部署及测试入口;纳入配置管理兼容与首次安全引导修复;排除本机配置、密钥和测试产物。
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
||
|
||
import { defineConfig } from 'vite'
|
||
import vue from '@vitejs/plugin-vue'
|
||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||
import { viteSingleFile } from 'vite-plugin-singlefile'
|
||
import AutoImport from 'unplugin-auto-import/vite'
|
||
import Components from 'unplugin-vue-components/vite'
|
||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||
import svgLoader from 'vite-svg-loader'
|
||
|
||
// https://vite.dev/config/
|
||
export default defineConfig({
|
||
plugins: [
|
||
vue(),
|
||
vueDevTools(),
|
||
// 加载 SVG 文件为 Vue 组件
|
||
svgLoader(),
|
||
// 打包为单文件
|
||
viteSingleFile(),
|
||
// 自动导入 Element Plus 相关函数,如:ElMessage, ElNotification 等
|
||
AutoImport({
|
||
resolvers: [ElementPlusResolver()],
|
||
}),
|
||
// 自动导入 Element Plus 组件
|
||
Components({
|
||
resolvers: [ElementPlusResolver()],
|
||
}),
|
||
],
|
||
resolve: {
|
||
alias: {
|
||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||
},
|
||
},
|
||
build: {
|
||
// 输出目录
|
||
outDir: fileURLToPath(new URL('../../out/plugins/telegram-ui', import.meta.url)),
|
||
emptyOutDir: false,
|
||
},
|
||
})
|