import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
import vueDevTools from 'vite-plugin-vue-devtools'
import path from 'path'

export default defineConfig({
  root: path.resolve(__dirname, '.'),
  plugins: [vue(), vueDevTools(), tailwindcss()],
  build: {
    outDir: './dist', // Output to Nginx served directory
    emptyOutDir: true,
  },
  server: {
    host: '0.0.0.0', // Allow Docker container access
    port: 4002,
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    },
  },
})
