36 lines
847 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
envDir: './',
publicDir: "/recharge-print",
base: './',
server: {
port: 3001,
proxy: {
'/api3': {
target: `https://zgd.hbhcbn.com/`,
changeOrigin: true,
secure: false,
// rewrite: path => path.replace(/^\/api3/, "")
},
'/api': {
// target: `http://localhost:8000`,
target: `https://zgd.hbhcbn.com/api3/`,
changeOrigin: true,
secure: false,
rewrite: path => path.replace(/^\/api/, "")
},
'/test': {
target: `http://127.0.0.1:8081`,
changeOrigin: true,
secure: false,
rewrite: path => path.replace(/^\/test/, "")
}
}
}
})