mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-21 03:44:21 +00:00
fix: 还原配置
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import path from 'path'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { createViteProxy } from './config'
|
||||
|
||||
export default defineConfig((env) => {
|
||||
const viteEnv = loadEnv(env.mode, process.cwd()) as unknown as ImportMetaEnv
|
||||
|
||||
const isOpenProxy = viteEnv.VITE_GLOB_HTTP_PROXY === 'Y'
|
||||
|
||||
return {
|
||||
resolve: {
|
||||
alias: {
|
||||
@@ -19,7 +16,13 @@ export default defineConfig((env) => {
|
||||
host: '0.0.0.0',
|
||||
port: 1002,
|
||||
open: false,
|
||||
proxy: createViteProxy(isOpenProxy, viteEnv),
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: viteEnv.VITE_APP_API_BASE_URL,
|
||||
changeOrigin: true, // 允许跨域
|
||||
rewrite: path => path.replace('/api/', '/'),
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
reportCompressedSize: false,
|
||||
|
Reference in New Issue
Block a user