xiaohongTest/vite.config.js
2024-02-19 09:37:57 +08:00

30 lines
627 B
JavaScript

import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
// vite 相关配置
server: {
// port: 80,
// host: true,
// open: true,
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/api': {
target: 'https://openapi-apaas.seeyonv8.com',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api/, '')
}
}
}
})