123456789101112131415161718192021222324252627282930313233343536 |
- import { defineConfig, loadEnv } from 'vite'
- import vue from '@vitejs/plugin-vue'
- // https://vitejs.dev/config/
- import { resolve } from "path";
- const pathSrc = resolve(__dirname, "src");
- export default defineConfig(({ mode }) => {
- const config = loadEnv(mode, './')
- return {
- plugins: [
- vue(),
- ],
- server: {
- proxy: {
- '/api': {
- target: 'http://192.168.11.77:8888',
- changeOrigin: true,
- rewrite: (path) => {
- return path.replace(/\/api/, '/api')
- }
- },
- '/app': {
- target: 'http://192.168.11.77:8080',
- changeOrigin: true,
- rewrite: (path) => {
- return path.replace(/\/app/, '/api')
- }
- }
- }
- },
- resolve: {
- alias: {
- "@": pathSrc,
- },
- },
- }
- })
|