vite.config.mts 579 B

123456789101112131415161718192021222324252627
  1. import { defineConfig } from '@vben/vite-config';
  2. import ElementPlus from 'unplugin-element-plus/vite';
  3. export default defineConfig(async () => {
  4. return {
  5. application: {},
  6. vite: {
  7. plugins: [
  8. ElementPlus({
  9. format: 'esm',
  10. }),
  11. ],
  12. server: {
  13. proxy: {
  14. '/api': {
  15. changeOrigin: true,
  16. rewrite: (path) => path.replace(/^\/api/, ''),
  17. // mock代理目标地址
  18. target: 'http://localhost:5320/api',
  19. ws: true,
  20. },
  21. },
  22. },
  23. },
  24. };
  25. });