vite.config.mts 554 B

123456789101112131415161718192021222324
  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: [ElementPlus({
  8. format:"esm"
  9. })],
  10. server: {
  11. proxy: {
  12. '/api': {
  13. changeOrigin: true,
  14. rewrite: (path) => path.replace(/^\/api/, ''),
  15. // mock代理目标地址
  16. target: 'http://localhost:5320/api',
  17. ws: true,
  18. },
  19. },
  20. },
  21. },
  22. };
  23. });