- 关闭预览自动弹出页面 - 关闭热更新 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
723 B
TypeScript
34 lines
723 B
TypeScript
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(() => {
|
|
return {
|
|
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,
|
|
hmr: false,
|
|
port: 5173
|
|
},
|
|
// 生产预览服务器配置 (vite preview) - 仅用于本地测试
|
|
preview: {
|
|
host: '0.0.0.0',
|
|
port: 3000,
|
|
cors: true
|
|
}
|
|
}
|
|
})
|