import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import path from 'node:path'

export default defineConfig({
  plugins: [svelte()],
  resolve: {
    alias: {
      '@agor/types': path.resolve(__dirname, 'packages/types/index.ts'),
      '@agor/stores': path.resolve(__dirname, 'packages/stores/index.ts'),
    },
  },
  server: {
    port: 9710,
    strictPort: true,
  },
  clearScreen: false,
  test: {
    include: [
      'src/**/*.test.ts',
      'packages/**/*.test.ts',
      'sidecar/**/*.test.ts',
      ...(process.env.AGOR_EDITION === 'pro' ? ['tests/commercial/**/*.test.ts'] : []),
    ],
  },
})
