import { defineConfig } from 'vite'
import { resolve } from 'path'

export default defineConfig({
  base: '/geograsim/App/',
  resolve: {
    alias: {
      '@core': resolve(__dirname, 'src/core'),
      '@sims': resolve(__dirname, 'src/sims'),
      '@ui': resolve(__dirname, 'src/ui'),
      '@styles': resolve(__dirname, 'src/styles'),
    },
  },
  server: {
    port: 3000,
    open: true,
  },
  build: {
    outDir: 'dist',
    sourcemap: true,
    manifest: true,
    rollupOptions: {
      input: {
        main:         resolve(__dirname, 'index.html'),
        game:         resolve(__dirname, 'game.html'),
        game3d:       resolve(__dirname, 'game-3d.html'),
        erdbeben:     resolve(__dirname, 'erdbeben.html'),
        energiemix:   resolve(__dirname, 'energiemix.html'),
        lieferketten: resolve(__dirname, 'lieferketten.html'),
        regenwald:    resolve(__dirname, 'regenwald.html'),
        sim:          resolve(__dirname, 'sim.html'),
        dashboard:    resolve(__dirname, 'dashboard.html'),
        stilauswahl:  resolve(__dirname, 'stilauswahl.html'),
        fluss:        resolve(__dirname, 'fluss.html'),
      },
    },
  },
  test: {
    globals: true,
    environment: 'jsdom',
  },
})
