vite.config.ts.yanhuaguo 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // vite.config.ts
  2. import { defineApplicationConfig } from "file:///Users/yanhuaguo/work/golang/src/ascrm/wechat-ui/internal/vite-config/dist/index.mjs";
  3. export default defineApplicationConfig({
  4. overrides: {
  5. optimizeDeps: {
  6. include: [
  7. 'echarts/core',
  8. 'echarts/charts',
  9. 'echarts/components',
  10. 'echarts/renderers',
  11. '@iconify/iconify',
  12. 'ant-design-vue/es/locale/zh_CN',
  13. 'ant-design-vue/es/locale/en_US',
  14. ],
  15. },
  16. server: {
  17. proxy: {
  18. "/api":{
  19. target: 'http://localhost:19101',
  20. changeOrigin: true,
  21. ws: true,
  22. rewrite: (path) => path.replace(new RegExp(`^/api`), ''),
  23. },
  24. '/sys-api': {
  25. target: 'http://localhost:9100',
  26. changeOrigin: true,
  27. ws: true,
  28. rewrite: (path) => path.replace(new RegExp(`^/sys-api`), ''),
  29. // only https
  30. // secure: false
  31. },
  32. '/fms-api': {
  33. target: 'http://localhost:9102',
  34. changeOrigin: true,
  35. ws: true,
  36. rewrite: (path) => path.replace(new RegExp(`^/fms-api`), ''),
  37. },
  38. '/mms-api': {
  39. target: 'http://localhost:9104',
  40. changeOrigin: true,
  41. ws: true,
  42. rewrite: (path) => path.replace(new RegExp(`^/mms-api`), ''),
  43. },
  44. '/wechat-api': {
  45. target: 'http://localhost:19101',
  46. changeOrigin: true,
  47. ws: true,
  48. rewrite: (path) => path.replace(new RegExp(`^/wechat-api`), ''),
  49. },
  50. },
  51. warmup: {
  52. clientFiles: ['./index.html', './src/{views,components}/*'],
  53. },
  54. },
  55. },
  56. });