import { defineConfig } from '@velofex/vite-config';

export default defineConfig(async () => {
  return {
    application: {},
    vite: {
      resolve: {
        alias: {
          '@': '/src',
        },
      },
      server: {
        proxy: {
          '/api': {
            changeOrigin: true,
            rewrite: (path) => path.replace(/^\/api/, ''),
            target: 'http://ab.dev.jbpm.shalu.com/',
            ws: true,
          },
          '/eapi': {
            changeOrigin: true,
            rewrite: (path) => path.replace(/^\/eapi/, '/api'),
            target: 'http://a.dev.jbpm.shalu.com/',
            ws: true,
          },
        },
      },
    },
  };
});
