You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
612 B
25 lines
612 B
import { fileURLToPath, URL } from 'node:url';
|
|
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import vueDevTools from 'vite-plugin-vue-devtools';
|
|
|
|
export default defineConfig({
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://192.168.8.235:8000', // 后端服务器地址
|
|
changeOrigin: true, // 改变请求源
|
|
rewrite: (path) => path.replace(/^\/api/, '') // 重写路径,去掉 /api
|
|
}
|
|
}
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
vueDevTools()
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
}
|
|
});
|