创建项目

This commit is contained in:
浅念
2025-11-19 18:02:33 +08:00
commit 6e01a14964
40 changed files with 13497 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig(({ mode }) => {
// 加载环境变量
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [vue()],
base: env.VITE_BASE_URL || '/',
server: {
port: parseInt(env.VITE_PORT) || 3000,
proxy: {
'/api': {
target: env.VITE_API_URL || 'http://localhost:4000',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
},
host: true,
allowedHosts: [
'bsh.yw.hnzhwlkj.cn'
]
},
}
})