feat: 初始化web项目,接口创建种子用户
This commit is contained in:
21
apps/web/vite.config.ts
Normal file
21
apps/web/vite.config.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
// 加载环境变量
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
|
||||
return {
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: parseInt(env.VITE_PORT || '5173', 10),
|
||||
host: true, // 允许外部访问
|
||||
open: true, // 自动打开浏览器
|
||||
},
|
||||
preview: {
|
||||
port: parseInt(env.VITE_PORT || '4173', 10),
|
||||
host: true,
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user