mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-10 03:03:43 +08:00
feat(ui): web移动端初始化
This commit is contained in:
35
new-ui/projects/admin/vite.config.ts
Normal file
35
new-ui/projects/admin/vite.config.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
const { VITE_PROXY_BASE_URL, VITE_TARGET_URL } = loadEnv(mode, process.cwd());
|
||||
return {
|
||||
define: {
|
||||
__AUTH_KEY: "'Admin-Authorization'"
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
vueJsx(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
},
|
||||
server: {
|
||||
host: "0.0.0.0",
|
||||
port: 8100,
|
||||
proxy: {
|
||||
[VITE_PROXY_BASE_URL]: {
|
||||
target: VITE_TARGET_URL,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(VITE_PROXY_BASE_URL, ""),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user