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

export default defineConfig({
  plugins: [react()],
  root: resolve(__dirname, 'src/renderer'),
  base: './',
  build: {
    outDir: resolve(__dirname, 'dist/renderer'),
    emptyOutDir: true,
    rollupOptions: {
      input: {
        settings: resolve(__dirname, 'src/renderer/settings/index.html'),
        'setup-wizard': resolve(__dirname, 'src/renderer/setup-wizard/index.html'),
        'career-wizard': resolve(__dirname, 'src/renderer/career-wizard/index.html'),
        'backup-restore': resolve(__dirname, 'src/renderer/backup-restore/index.html'),
        'ignite-ai': resolve(__dirname, 'src/renderer/ignite-ai/index.html'),
        'learner-hub': resolve(__dirname, 'src/renderer/learner-hub/index.html'),
        actions: resolve(__dirname, 'src/renderer/actions/index.html'),
        extension: resolve(__dirname, 'src/renderer/extension/index.html')
      }
    }
  },
  server: {
    port: 5173
  }
});
