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

export default defineConfig({
  plugins: [react()],
  base: './',
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
  define: {
    'import.meta.env.VITE_XMOV_APP_ID': JSON.stringify(process.env.XMOV_APP_ID || ''),
    'import.meta.env.VITE_XMOV_APP_SECRET': JSON.stringify(process.env.XMOV_APP_SECRET || ''),
  },
  build: {
    outDir: 'dist/elderly',
    rollupOptions: {
      input: {
        main: path.resolve(__dirname, 'elderly.html'),
      },
    },
  },
  server: {
    port: 3000,
    open: '/elderly.html',
  },
})
