vite.config.dev.ts 1.5 KB

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