feat: 联调
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
const path = require('path')
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default ({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
return defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
@@ -14,17 +14,21 @@ export default ({ mode }) => {
|
||||
'@utils': path.resolve(__dirname, 'src/utils'),
|
||||
'@components': path.resolve(__dirname, 'src/components'),
|
||||
'@imgs': path.resolve(__dirname, 'src/imgs'),
|
||||
'@constants': path.resolve(__dirname, 'src/constants'),
|
||||
'@constants': path.resolve(__dirname, 'src/constants')
|
||||
}
|
||||
},
|
||||
plugins: [react()],
|
||||
server: {
|
||||
proxy: {
|
||||
"/subject": {
|
||||
'/subject': {
|
||||
target: env.VITE_API_HOST,
|
||||
changeOrigin: true,
|
||||
changeOrigin: true
|
||||
},
|
||||
},
|
||||
'/auth': {
|
||||
target: env.VITE_API_HOST,
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user