import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'node:path';

export default defineConfig({
  root: 'web',
  plugins: [react()],
  resolve: {
    alias: {
      // SET 19 — share pure aggregate helpers with the web Admin view.
      '@tier1/statsAggregate': path.resolve(__dirname, 'src/tier1/statsAggregate.ts'),
    },
  },
  build: { outDir: 'dist', emptyOutDir: true },
  server: {
    port: 5173,
    proxy: { '/api': 'http://localhost:4100' },
    fs: { allow: [path.resolve(__dirname)] },
  },
});
