refactor: cleanup template and add new pages
- Remove unused template files (frontend-code-interpreter, template-renderer) - Add home, test1, test2, zh-en-translator pages - Update router configuration - Add Docker and tailwind config - Update environment files and configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,27 +1,33 @@
|
||||
import {defineConfig, loadEnv} from 'vite'
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import path from 'path'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(({mode}) => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
|
||||
export default defineConfig(() => {
|
||||
return {
|
||||
plugins: [react()],
|
||||
server: {
|
||||
headers: {
|
||||
'Cross-Origin-Embedder-Policy': 'require-corp',
|
||||
'Cross-Origin-Opener-Policy': 'same-origin',
|
||||
},
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: env.VITE_API_BASE,
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
toProxy: true,
|
||||
rewrite: (path: string) => path.replace(new RegExp(`^/api`), '')
|
||||
}
|
||||
base: './',
|
||||
plugins: [tailwindcss(), react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src')
|
||||
}
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['dayjs/locale/zh-cn']
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
allowedHosts: true as true,
|
||||
cors: true,
|
||||
open: true,
|
||||
port: 5173
|
||||
},
|
||||
// 生产预览服务器配置 (vite preview) - 仅用于本地测试
|
||||
preview: {
|
||||
host: '0.0.0.0',
|
||||
port: 3000,
|
||||
cors: true
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user