hsgy/vite.config.js

36 lines
762 B
Vue
Raw Permalink Normal View History

2023-10-30 16:52:19 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vitePluginImport from 'vite-plugin-babel-import';
import path from 'path'
const baseUrl = {
development: './',
beta: './',
release: './'
}
// https://vitejs.dev/config/
export default ({ mode }) => defineConfig({
plugins: [
vue()
],
base: baseUrl[mode],
resolve: {
alias: {
'~': path.resolve(__dirname, './'),
'@': path.resolve(__dirname, 'src')
}
},
server: {
proxy: {
'/api': {
2023-12-13 12:04:28 +08:00
// target: 'http://whh.shikicc.com:52189',
2023-12-24 15:01:52 +08:00
target: 'http://192.168.2.6:6688',
2023-10-30 16:52:19 +08:00
changeOrigin: true,
2023-12-24 15:01:52 +08:00
rewrite: path => path.replace(/^\/api/, '')
// rewrite: path => path.replace(/^\//, '')
2023-10-30 16:52:19 +08:00
}
}
}
})