Files
u-desk/frontend/vite.config.js
T
lxy e7a2c5148e 新增: 文件操作增强与预览扩展
- 文件剪贴板复制剪切粘贴,重名自动副本
- SFTP下载到本机与外部文件拖入,目录递归
- 传输进度浮动面板,transfer-progress事件链
- Drawio预览,Excel工作线程,冻结看门狗
- cmd与bat自写batch语法高亮,psm1等映射补齐
2026-09-15 22:26:12 +08:00

54 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import { fileURLToPath } from 'url'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ArcoResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({
plugins: [
vue(),
AutoImport({
imports: ['vue'],
dts: 'src/auto-imports.d.ts',
}),
Components({
resolvers: [ArcoResolver({ sideEffect: true })],
dts: 'src/components.d.ts',
})
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
'@bindings': resolve(__dirname, 'bindings'),
'@wailsio/events': fileURLToPath(new URL('./node_modules/@wailsio/runtime/dist/events.js', import.meta.url))
}
},
// Excel 解析 / 卡死看门狗使用 module worker(new Worker(url,{type:'module'})),
// 且 worker 内部用了动态 import('xlsx') 需要代码分割,故 worker 格式必须为 es。
// 目标平台 Windows WebView2(Chromium) 完整支持 module worker。
worker: {
format: 'es'
},
build: {
outDir: 'dist',
emptyOutDir: true,
sourcemap: false,
minify: 'esbuild',
cssCodeSplit: true,
chunkSizeWarningLimit: 1000,
target: 'es2020',
rollupOptions: {
output: {
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js',
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]'
}
}
},
optimizeDeps: {
include: ['vue', 'pinia', '@arco-design/web-vue', 'marked', 'highlight.js']
}
})