This commit is contained in:
2025-01-02 15:46:20 +08:00
parent 31b1f4103f
commit 2be5060095
7 changed files with 676 additions and 8 deletions

36
vite.config.mjs Normal file
View File

@@ -0,0 +1,36 @@
import { defineConfig } from 'vite';
import basicSsl from '@vitejs/plugin-basic-ssl';
import dayjs from 'dayjs';
import path from 'path';
const isDev = process.env.NODE_ENV === 'development';
const BUILD_TIME = dayjs().format('YYYY-MM-DD HH:mm:ss');
export default defineConfig({
plugins: [basicSsl()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
define: {
DEV_SERVER: JSON.stringify(isDev),
BUILD_TIME: JSON.stringify(BUILD_TIME),
},
server: {
port: 6025,
host: '0.0.0.0',
proxy: {
'/api': {
target: 'https://kevisual.xiongxiao.me',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '/api'),
},
'/system': {
target: 'https://kevisual.xiongxiao.me',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/system/, '/system'),
},
},
},
});