init:库尔勒妇幼项目初始化

This commit is contained in:
Elliott
2025-07-23 14:39:14 +08:00
commit 8c9d4af4e0
55 changed files with 13218 additions and 0 deletions

62
vite.config.js Normal file
View File

@@ -0,0 +1,62 @@
import {defineConfig, loadEnv} from 'vite'
import path from 'path'
import createVitePlugins from './vite/plugins'
export default defineConfig(({mode, command}) => {
const env = loadEnv(mode, process.cwd())
const {VITE_APP_ENV} = env
return {
base: VITE_APP_ENV === 'production' ? '/' : '/',
plugins: createVitePlugins(env, command === 'build'),
resolve: {
// https://cn.vitejs.dev/config/#resolve-alias
alias: {
// 设置路径
'~':
path.resolve(__dirname, './'),
// 设置别名
'@':
path.resolve(__dirname, './src')
}
,
// https://cn.vitejs.dev/config/#resolve-extensions
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
}
,
// vite 相关配置
server: {
hmr: true,
port:
8099,
host:
true,
open:
true,
proxy:
{
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api':
{
target: 'http://localhost:8083',
// target: 'http://110.153.1.138:8081',
changeOrigin:
true,
rewrite:
(p) => p.replace(/^\/dev-api/, ''),
}
,
'/prod-api':
{
target: 'http://110.153.1.138:8081',
changeOrigin:
true,
rewrite:
(p) => p.replace(/^\/prod-api/, '/prod-api/'),
}
}
}
,
}
})