新增 现在支持编译为Windows桌面端

This commit is contained in:
2025-10-05 05:45:34 +08:00
parent e30e5b4fe2
commit 29d4152e81
21 changed files with 6008 additions and 3453 deletions

View File

@@ -1,8 +1,15 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import * as path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import * as path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
base: './', // 添加这行以确保资源路径正确
publicDir: path.resolve(__dirname, 'public'), // 使用绝对路径指定 public 目录
plugins: [react()],
optimizeDeps: {
exclude: ['lucide-react'],
@@ -14,4 +21,20 @@ export default defineConfig({
'react-day-picker/locale': 'date-fns/locale',
},
},
});
build: {
outDir: 'dist',
assetsDir: 'assets',
rollupOptions: {
output: {
entryFileNames: 'assets/[name].[hash].js',
chunkFileNames: 'assets/[name].[hash].js',
assetFileNames: 'assets/[name].[hash].[ext]',
},
},
// 确保 public 目录下的文件被复制到 dist 目录
copyPublicDir: true,
},
define: {
'import.meta.env.VITE_DEV_SERVER_URL': JSON.stringify(process.env.VITE_DEV_SERVER_URL),
},
});