Initial commit

This commit is contained in:
2026-04-13 20:28:09 +08:00
commit e2a2eb4666
62 changed files with 17589 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import { defineConfig, loadEnv } from 'vite';
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
// 手动定义 __dirname 以确保在 Windows 下的兼容性
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, '.', '');
return {
plugins: [react(), tailwindcss()],
define: {
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY),
},
resolve: {
alias: {
// 使用 resolve 确保路径在 Windows/Linux 下都能正确解析
'@': resolve(__dirname, './src'),
},
},
server: {
port: 3000,
host: '0.0.0.0',
},
};
});