vite.config.ts 738 B

123456789101112131415161718192021222324252627282930
  1. import { fileURLToPath, URL } from 'node:url'
  2. import { defineConfig } from 'vite'
  3. import vue from '@vitejs/plugin-vue'
  4. import vueDevTools from 'vite-plugin-vue-devtools'
  5. // https://vite.dev/config/
  6. export default defineConfig({
  7. plugins: [vue(), vueDevTools()],
  8. resolve: {
  9. alias: {
  10. '@': fileURLToPath(new URL('./src', import.meta.url)),
  11. },
  12. },
  13. server: {
  14. proxy: {
  15. '/fileManager': {
  16. target: 'http://192.168.2.24:8803',
  17. ws: true,
  18. changeOrigin: true,
  19. rewrite: (path) => path.replace(/^\/api/, ''),
  20. },
  21. '/api': {
  22. target: 'http://192.168.2.107:8099',
  23. changeOrigin: true,
  24. // rewrite: (path) => path.replace(/^\/api/, ''),
  25. },
  26. },
  27. },
  28. })